[SHELL32_APITEST]
authorAmine Khaldi <amine.khaldi@reactos.org>
Tue, 11 Mar 2014 13:06:09 +0000 (13:06 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Tue, 11 Mar 2014 13:06:09 +0000 (13:06 +0000)
* Plug some leaks. CIDs 11063621106363 and 1106364.
CORE-7975

svn path=/trunk/; revision=62474

rostests/apitests/shell32/menu.cpp

index 8fd046a..38e15d6 100644 (file)
@@ -11,7 +11,11 @@ BOOL CheckWindowClass(HWND hwnd, PCWSTR className)
 {
     ULONG size = (wcslen(className) + 1)* sizeof(WCHAR);
     PWCHAR buffer = (PWCHAR)malloc(size);
-    if (GetClassNameW(hwnd, buffer, size ) == 0) return FALSE;
+    if (GetClassNameW(hwnd, buffer, size ) == 0)
+    {
+        free(buffer);
+        return FALSE;
+    }
     int res = wcscmp(buffer, className);
     free(buffer);
     return res == 0;
@@ -161,6 +165,7 @@ void test_CShellMenu()
     if (!CreateCShellMenu(&shellMenu, &dockingMenu, &menuWithSite))
     {
         skip("failed to create CShellMenuObject\n");
+        delete dummyWindow;
         return;
     }
 
@@ -288,6 +293,7 @@ void test_CShellMenu_callbacks(IShellFolder *shellFolder, HMENU hmenu)
     if (!CreateCShellMenu(&shellMenu, &dockingMenu, &menuWithSite))
     {
         skip("failed to create CShellMenuObject\n");
+        delete dummyWindow;
         return;
     }