[PATCH] opcservices/tests: Fix some memory leaks (Valgrind).

Sven Baars sven.wine at gmail.com
Wed Jan 16 13:13:02 CST 2019


Signed-off-by: Sven Baars <sven.wine at gmail.com>
---
 dlls/opcservices/tests/opcservices.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/opcservices/tests/opcservices.c b/dlls/opcservices/tests/opcservices.c
index 9792302f7e..939a118387 100644
--- a/dlls/opcservices/tests/opcservices.c
+++ b/dlls/opcservices/tests/opcservices.c
@@ -356,7 +356,10 @@ static void test_relationship(void)
     hr = IOpcFactory_CreatePackage(factory, &package);
     ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) /* Vista */, "Failed to create a package, hr %#x.\n", hr);
     if (FAILED(hr))
+    {
+        IOpcFactory_Release(factory);
         return;
+    }
 
     hr = CreateUri(targetW, Uri_CREATE_ALLOW_RELATIVE, 0, &target_uri);
     ok(SUCCEEDED(hr), "Failed to create target uri, hr %#x.\n", hr);
@@ -1201,6 +1204,7 @@ static void test_create_part_uri(void)
         ok(!!ret, "%u: unexpected result %d.\n", i, ret);
 
         IOpcPartUri_Release(part_uri);
+        IOpcPartUri_Release(uri);
 
         heap_free(inputW);
         heap_free(rawW);
-- 
2.17.1




More information about the wine-devel mailing list