win32: fix possible memleak if GlobalAlloc() fails

Also remove the unused 'buf' variable.

https://bugzilla.gnome.org/show_bug.cgi?id=694742
This commit is contained in:
Aleksander Morgado
2013-02-26 14:51:31 +01:00
parent 5e4e724a8e
commit 399ffbb230

View File

@ -147,7 +147,7 @@ _gdk_win32_window_change_property (GdkWindow *window,
{ {
HGLOBAL hdata; HGLOBAL hdata;
gint i, size; gint i, size;
guchar *ucptr, *buf = NULL; guchar *ucptr;
wchar_t *wcptr, *p; wchar_t *wcptr, *p;
glong wclen; glong wclen;
@ -206,7 +206,7 @@ _gdk_win32_window_change_property (GdkWindow *window,
WIN32_API_FAILED ("GlobalAlloc"); WIN32_API_FAILED ("GlobalAlloc");
if (!CloseClipboard ()) if (!CloseClipboard ())
WIN32_API_FAILED ("CloseClipboard"); WIN32_API_FAILED ("CloseClipboard");
g_free (buf); g_free (wcptr);
return; return;
} }