Bug 623169 - Memory leaks in GIMP
Plug leak by allocating the data on the stack.
This commit is contained in:
@ -653,13 +653,12 @@ dx_dinput_event_dispatch (GSource *source,
|
|||||||
gint i;
|
gint i;
|
||||||
GimpControllerEvent cevent = { 0, };
|
GimpControllerEvent cevent = { 0, };
|
||||||
|
|
||||||
data = g_malloc (format->dwDataSize);
|
data = g_alloca (format->dwDataSize);
|
||||||
|
|
||||||
if (FAILED ((hresult = IDirectInputDevice8_GetDeviceState (input->didevice8,
|
if (FAILED ((hresult = IDirectInputDevice8_GetDeviceState (input->didevice8,
|
||||||
format->dwDataSize,
|
format->dwDataSize,
|
||||||
data))))
|
data))))
|
||||||
{
|
{
|
||||||
g_free (data);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user