Huw Davies : browseui: Fix several memory leaks in the tests.

Alexandre Julliard julliard at winehq.org
Mon Dec 14 09:51:11 CST 2009


Module: wine
Branch: master
Commit: f75981c712ffb38dc08eeb8c25fac78cff988458
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f75981c712ffb38dc08eeb8c25fac78cff988458

Author: Huw Davies <huw at codeweavers.com>
Date:   Sat Dec 12 14:21:17 2009 +0000

browseui: Fix several memory leaks in the tests.

Found by Valgrind.

---

 dlls/browseui/tests/autocomplete.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/browseui/tests/autocomplete.c b/dlls/browseui/tests/autocomplete.c
index 85a7da5..84be84d 100644
--- a/dlls/browseui/tests/autocomplete.c
+++ b/dlls/browseui/tests/autocomplete.c
@@ -219,6 +219,7 @@ IACListVtbl TestACL_ACListVtbl =
     ole_ok(obj->lpVtbl->Next(obj, 1, &wstr, &i)); \
     ok(i == 1, "Expected i == 1, got %d\n", i); \
     ok(str[0] == wstr[0], "String mismatch\n"); \
+    CoTaskMemFree(wstr); \
 }
 
 #define expect_end(obj) \
@@ -280,9 +281,13 @@ static void test_ACLMulti(void)
 
     ole_ok(obj->lpVtbl->Next(obj, 15, wstrtab, &i));
     ok(i == 1, "Expected i == 1, got %d\n", i);
+    CoTaskMemFree(wstrtab[0]);
     ole_ok(obj->lpVtbl->Next(obj, 15, wstrtab, &i));
+    CoTaskMemFree(wstrtab[0]);
     ole_ok(obj->lpVtbl->Next(obj, 15, wstrtab, &i));
+    CoTaskMemFree(wstrtab[0]);
     ole_ok(obj->lpVtbl->Next(obj, 15, wstrtab, &i));
+    CoTaskMemFree(wstrtab[0]);
     ole_ok(acl->lpVtbl->Expand(acl, exp));
     ok(acl1->expcount == 2, "expcount - expected 1, got %d\n", acl1->expcount);
     ok(acl2->expcount == 0 /* XP */ || acl2->expcount == 2 /* Vista */,




More information about the wine-cvs mailing list