From 2c26c653a9fac5114350a2dc2e6c68f534c7b61e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 11 Mar 2014 13:06:09 +0000 Subject: [PATCH] [SHELL32_APITEST] * Plug some leaks. CIDs 1106362, 1106363 and 1106364. CORE-7975 svn path=/trunk/; revision=62474 --- rostests/apitests/shell32/menu.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rostests/apitests/shell32/menu.cpp b/rostests/apitests/shell32/menu.cpp index 8fd046a6dc1..38e15d6dcdf 100644 --- a/rostests/apitests/shell32/menu.cpp +++ b/rostests/apitests/shell32/menu.cpp @@ -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; }