]> Pileus Git - ~andy/gtk/commitdiff
win32: fix possible memleak if GlobalAlloc() fails
authorAleksander Morgado <aleksander@lanedo.com>
Tue, 26 Feb 2013 13:51:31 +0000 (14:51 +0100)
committerAleksander Morgado <aleksander@lanedo.com>
Tue, 26 Feb 2013 14:13:32 +0000 (15:13 +0100)
Also remove the unused 'buf' variable.

https://bugzilla.gnome.org/show_bug.cgi?id=694742

gdk/win32/gdkproperty-win32.c

index 04cf3e39af1ff0b2d8f9002c7dc0d19a84ec10b9..7a3671beb58145bd900c252dae6d1ead0189c487 100644 (file)
@@ -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;
            }