From 35dbc201ae3e2540127c0efd01ac64931cbcac18 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 19 Nov 2009 10:11:12 -0800 Subject: [PATCH] cryptnet: Fix memory leaks querying an object. --- dlls/cryptnet/cryptnet_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index 9301a56733..8a803ebed1 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -1246,20 +1246,24 @@ static BOOL WINAPI CRYPT_CreateAny(LPCSTR pszObjectOid, if (!CertAddCertificateContextToStore(store, context, CERT_STORE_ADD_ALWAYS, NULL)) ret = FALSE; + CertFreeCertificateContext(context); break; case CERT_QUERY_CONTENT_CRL: if (!CertAddCRLContextToStore(store, context, CERT_STORE_ADD_ALWAYS, NULL)) ret = FALSE; + CertFreeCRLContext(context); break; case CERT_QUERY_CONTENT_CTL: if (!CertAddCTLContextToStore(store, context, CERT_STORE_ADD_ALWAYS, NULL)) ret = FALSE; + CertFreeCTLContext(context); break; default: CertAddStoreToCollection(store, contextStore, 0, 0); } + CertCloseStore(contextStore, 0); } else ret = FALSE;