From: Aleksander Morgado Date: Tue, 26 Feb 2013 13:51:31 +0000 (+0100) Subject: win32: fix possible memleak if GlobalAlloc() fails X-Git-Url: http://pileus.org/git/?p=~andy%2Fgtk;a=commitdiff_plain;h=399ffbb230d4be903a172bf9b6c3df90e7c35035 win32: fix possible memleak if GlobalAlloc() fails Also remove the unused 'buf' variable. https://bugzilla.gnome.org/show_bug.cgi?id=694742 --- diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c index 04cf3e39a..7a3671beb 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; }