[gtk+] win32: fix possible memleak if GlobalAlloc() fails



commit 399ffbb230d4be903a172bf9b6c3df90e7c35035
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Tue Feb 26 14:51:31 2013 +0100

    win32: fix possible memleak if GlobalAlloc() fails
    
    Also remove the unused 'buf' variable.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694742

 gdk/win32/gdkproperty-win32.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c
index 04cf3e3..7a3671b 100644
--- a/gdk/win32/gdkproperty-win32.c
+++ b/gdk/win32/gdkproperty-win32.c
@@ -147,7 +147,7 @@ _gdk_win32_window_change_property (GdkWindow    *window,
 {
   HGLOBAL hdata;
   gint i, size;
-  guchar *ucptr, *buf = NULL;
+  guchar *ucptr;
   wchar_t *wcptr, *p;
   glong wclen;
 
@@ -206,7 +206,7 @@ _gdk_win32_window_change_property (GdkWindow    *window,
              WIN32_API_FAILED ("GlobalAlloc");
              if (!CloseClipboard ())
                WIN32_API_FAILED ("CloseClipboard");
-             g_free (buf);
+             g_free (wcptr);
              return;
            }
 


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