Huw Davies : oleaut32: Fix memory leaks in the tests.

Alexandre Julliard julliard at winehq.org
Wed Dec 16 09:41:35 CST 2009


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Wed Dec 16 09:56:54 2009 +0000

oleaut32: Fix memory leaks in the tests.

Found by Valgrind.

---

 dlls/oleaut32/tests/vartype.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c
index 8f19294..a61c777 100644
--- a/dlls/oleaut32/tests/vartype.c
+++ b/dlls/oleaut32/tests/vartype.c
@@ -3484,6 +3484,7 @@ static void test_VarDateChangeTypeEx(void)
           (!lstrcmpW(V_BSTR(&vDst), sz25570) || !lstrcmpW(V_BSTR(&vDst), sz25570_2)),
           "hres=0x%X, type=%d (should be VT_BSTR), *bstr=%s\n", 
           hres, V_VT(&vDst), V_BSTR(&vDst) ? wtoascii(V_BSTR(&vDst)) : "?");
+  VariantClear(&vDst);
 
   lcid = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT);
   if (HAVE_OLEAUT32_LOCALES)
@@ -3492,6 +3493,7 @@ static void test_VarDateChangeTypeEx(void)
     ok(hres == S_OK && V_VT(&vDst) == VT_BSTR && V_BSTR(&vDst) && !lstrcmpW(V_BSTR(&vDst), sz25570Nls), 
             "hres=0x%X, type=%d (should be VT_BSTR), *bstr=%s\n", 
             hres, V_VT(&vDst), V_BSTR(&vDst) ? wtoascii(V_BSTR(&vDst)) : "?");
+    VariantClear(&vDst);
   }
 }
 
@@ -4780,7 +4782,8 @@ static void test_VarBoolCopy(void)
   ok(hres == S_OK && V_VT(&vDst) == VT_BSTR && \
      V_BSTR(&vDst) && !memcmp(V_BSTR(&vDst), str, sizeof(str)), \
      "hres=0x%X, type=%d (should be VT_BSTR), *bstr='%c'\n", \
-     hres, V_VT(&vDst), V_BSTR(&vDst) ? *V_BSTR(&vDst) : '?')
+     hres, V_VT(&vDst), V_BSTR(&vDst) ? *V_BSTR(&vDst) : '?'); \
+  VariantClear(&vDst)
 
 static void test_VarBoolChangeTypeEx(void)
 {




More information about the wine-cvs mailing list