From 2a9168e586e067a1c7a63efb3472f6e5194d6912 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Fri, 7 Dec 2007 14:14:33 +0000 Subject: [PATCH] oleaut32: Set the number of locks held on the safe arrays in the safe array tests to zero before destroying them, otherwise the operation will fail and leak memory. --- dlls/oleaut32/tests/usrmarshal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/oleaut32/tests/usrmarshal.c b/dlls/oleaut32/tests/usrmarshal.c index 31394426187..20fc2f82244 100644 --- a/dlls/oleaut32/tests/usrmarshal.c +++ b/dlls/oleaut32/tests/usrmarshal.c @@ -208,6 +208,7 @@ static void test_marshal_LPSAFEARRAY(void) LPSAFEARRAY_UserFree(&umcb.Flags, &lpsa2); } HeapFree(GetProcessHeap(), 0, buffer); + lpsa->cLocks = 0; SafeArrayDestroy(lpsa); /* test NULL safe array */ @@ -244,6 +245,7 @@ static void test_marshal_LPSAFEARRAY(void) check_safearray(buffer, lpsa); HeapFree(GetProcessHeap(), 0, buffer); + lpsa->cLocks = 0; SafeArrayDestroy(lpsa); /* VARTYPE-less arrays can be marshaled if cbElements is 1,2,4 or 8 as type SF_In */ @@ -1125,6 +1127,7 @@ static void test_marshal_VARIANT(void) VARIANT_UserFree(&umcb.Flags, &v2); } HeapFree(GetProcessHeap(), 0, buffer); + lpsa->cLocks = 0; SafeArrayDestroy(lpsa); /*** VARIANT BYREF ***/