From a15d4de557ac2ba3b2418cb39fc6080a7523e604 Mon Sep 17 00:00:00 2001 From: Gijs Vermeulen Date: Tue, 15 Jan 2019 17:05:10 +0100 Subject: [PATCH] crypt32/tests: Fix a memory leak (Valgrind). Signed-off-by: Gijs Vermeulen Signed-off-by: Alexandre Julliard --- 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 0adfeb85298..d862902c88d 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());