From e14c50aaefb41d077455b4cec1fa708cc14a3e7c Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Thu, 15 Jul 2010 21:40:56 +0200 Subject: [PATCH] Bug 623169 - Memory leaks in GIMP Plug leak by allocating the data on the stack. --- modules/controller-dx-dinput.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/controller-dx-dinput.c b/modules/controller-dx-dinput.c index f931885ccd..9e40d11821 100644 --- a/modules/controller-dx-dinput.c +++ b/modules/controller-dx-dinput.c @@ -653,13 +653,12 @@ dx_dinput_event_dispatch (GSource *source, gint i; GimpControllerEvent cevent = { 0, }; - data = g_malloc (format->dwDataSize); + data = g_alloca (format->dwDataSize); if (FAILED ((hresult = IDirectInputDevice8_GetDeviceState (input->didevice8, format->dwDataSize, data)))) { - g_free (data); return TRUE; }