Nikolay Sivov : oleaut32/tests: Fixed a couple of string leaks (Valgrind).

Alexandre Julliard julliard at winehq.org
Tue May 6 13:37:11 CDT 2014


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue May  6 11:57:48 2014 +0400

oleaut32/tests: Fixed a couple of string leaks (Valgrind).

---

 dlls/oleaut32/tests/olefont.c |    2 ++
 dlls/oleaut32/tests/vartest.c |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/dlls/oleaut32/tests/olefont.c b/dlls/oleaut32/tests/olefont.c
index ded1838..4f421e4 100644
--- a/dlls/oleaut32/tests/olefont.c
+++ b/dlls/oleaut32/tests/olefont.c
@@ -412,10 +412,12 @@ static void test_font_events_disp(void)
     IConnectionPoint_Release(pCP);
 
     fonteventsdisp_invoke_called = 0;
+    fonteventsdisp_invoke_arg0 = NULL;
     hr = IFont_put_Bold(pFont, TRUE);
     EXPECT_HR(hr, S_OK);
 
     ok(fonteventsdisp_invoke_called == 1, "IFontEventDisp::Invoke wasn't called once\n");
+    SysFreeString(fonteventsdisp_invoke_arg0);
 
     hr = IFont_QueryInterface(pFont, &IID_IFontDisp, (void **)&pFontDisp);
     EXPECT_HR(hr, S_OK);
diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c
index bfbc0b2..d139b42 100644
--- a/dlls/oleaut32/tests/vartest.c
+++ b/dlls/oleaut32/tests/vartest.c
@@ -5611,6 +5611,7 @@ static void test_VarCat(void)
     VARTYPE leftvt, rightvt, resultvt;
     HRESULT hres;
     HRESULT expected_error_num;
+    int cmp;
 
     CHECKPTR(VarCat);
 
@@ -5952,7 +5953,11 @@ static void test_VarCat(void)
     V_BSTR(&right) = SysAllocStringLen(NULL,0);
     hres = pVarCat(&left, &right, &result);
     ok(hres == S_OK, "VarCat failed: %08x\n", hres);
-    if(!strcmp_wa(V_BSTR(&result), "True")) {
+    VariantClear(&right);
+
+    cmp = strcmp_wa(V_BSTR(&result), "True");
+    VariantClear(&result);
+    if(!cmp) {
         V_VT(&right) = VT_BOOL;
         V_BOOL(&right) = 100;
         hres = pVarCat(&left, &right, &result);




More information about the wine-cvs mailing list