Author: cwittich
Date: Thu Sep 3 09:33:58 2015
New Revision: 68931
URL:
http://svn.reactos.org/svn/reactos?rev=68931&view=rev
Log:
[OSK] fix resource leak in error case CID 1322148
Modified:
trunk/reactos/base/applications/osk/main.c
Modified: trunk/reactos/base/applications/osk/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/osk/main…
==============================================================================
--- trunk/reactos/base/applications/osk/main.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/osk/main.c [iso-8859-1] Thu Sep 3 09:33:58 2015
@@ -40,10 +40,15 @@
hIcon = (HICON)LoadImage(Globals.hInstance, MAKEINTRESOURCE(IdResource),
IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
- if (hIcon == NULL) return FALSE;
+ if (hIcon == NULL)
+ return FALSE;
hWndItem = GetDlgItem(Globals.hMainWnd, IdDlgItem);
- if (hWndItem == NULL) return FALSE;
+ if (hWndItem == NULL)
+ {
+ DestroyIcon(hIcon);
+ return FALSE;
+ }
SendMessage(hWndItem, BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon);