Commit 35dbc201 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

cryptnet: Fix memory leaks querying an object.

parent 320407a1
...@@ -1246,20 +1246,24 @@ static BOOL WINAPI CRYPT_CreateAny(LPCSTR pszObjectOid, ...@@ -1246,20 +1246,24 @@ static BOOL WINAPI CRYPT_CreateAny(LPCSTR pszObjectOid,
if (!CertAddCertificateContextToStore(store, if (!CertAddCertificateContextToStore(store,
context, CERT_STORE_ADD_ALWAYS, NULL)) context, CERT_STORE_ADD_ALWAYS, NULL))
ret = FALSE; ret = FALSE;
CertFreeCertificateContext(context);
break; break;
case CERT_QUERY_CONTENT_CRL: case CERT_QUERY_CONTENT_CRL:
if (!CertAddCRLContextToStore(store, if (!CertAddCRLContextToStore(store,
context, CERT_STORE_ADD_ALWAYS, NULL)) context, CERT_STORE_ADD_ALWAYS, NULL))
ret = FALSE; ret = FALSE;
CertFreeCRLContext(context);
break; break;
case CERT_QUERY_CONTENT_CTL: case CERT_QUERY_CONTENT_CTL:
if (!CertAddCTLContextToStore(store, if (!CertAddCTLContextToStore(store,
context, CERT_STORE_ADD_ALWAYS, NULL)) context, CERT_STORE_ADD_ALWAYS, NULL))
ret = FALSE; ret = FALSE;
CertFreeCTLContext(context);
break; break;
default: default:
CertAddStoreToCollection(store, contextStore, 0, 0); CertAddStoreToCollection(store, contextStore, 0, 0);
} }
CertCloseStore(contextStore, 0);
} }
else else
ret = FALSE; ret = FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment