[gimp] Bug 623169 - Memory leaks in GIMP



commit e14c50aaefb41d077455b4cec1fa708cc14a3e7c
Author: Sven Neumann <sven gimp org>
Date:   Thu Jul 15 21:40:56 2010 +0200

    Bug 623169 - Memory leaks in GIMP
    
    Plug leak by allocating the data on the stack.

 modules/controller-dx-dinput.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/modules/controller-dx-dinput.c b/modules/controller-dx-dinput.c
index f931885..9e40d11 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;
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]