[PATCH] crypt32/tests: Fix a memory leak (Valgrind).

Gijs Vermeulen gijsvrm at gmail.com
Tue Jan 15 10:05:10 CST 2019


Signed-off-by: Gijs Vermeulen <gijsvrm at gmail.com>
---
 dlls/crypt32/tests/store.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/crypt32/tests/store.c b/dlls/crypt32/tests/store.c
index 0adfeb8529..d862902c88 100644
--- a/dlls/crypt32/tests/store.c
+++ b/dlls/crypt32/tests/store.c
@@ -2834,6 +2834,8 @@ static void testEmptyStore(void)
     ok(res, "CertDeleteCertificateContextFromStore failed\n");
     ok(cert3->hCertStore == cert->hCertStore, "Unexpected hCertStore\n");
 
+    CertFreeCertificateContext(cert3);
+
     store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL);
     ok(store != NULL, "CertOpenStore failed\n");
 
@@ -2847,6 +2849,7 @@ static void testEmptyStore(void)
     ok(cert3->hCertStore == store, "Unexpected hCertStore\n");
 
     CertCloseStore(store, 0);
+    CertFreeCertificateContext(cert3);
 
     res = CertCloseStore(cert->hCertStore, CERT_CLOSE_STORE_CHECK_FLAG);
     ok(!res && GetLastError() == E_UNEXPECTED, "CertCloseStore returned: %x(%x)\n", res, GetLastError());
-- 
2.20.1




More information about the wine-devel mailing list