cryptnet: Fix memory leaks querying an object.

This commit is contained in:
Juan Lang 2009-11-19 10:11:12 -08:00 committed by Alexandre Julliard
parent 320407a174
commit 35dbc201ae

View File

@ -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;