pki: Fix memory leaks in --signcrl if signature scheme is not found

Fixes: dd4bd21c5a ("pki: Query private key for supported signature schemes")
This commit is contained in:
Tobias Brunner 2019-04-30 10:25:56 +02:00
parent bc0a01ff2e
commit c88030807e
1 changed files with 3 additions and 3 deletions

View File

@ -416,9 +416,6 @@ static int sign_crl()
BUILD_CRL_DISTRIBUTION_POINTS, cdps, BUILD_BASE_CRL, baseCrlNumber,
BUILD_END);
enumerator->destroy(enumerator);
lastenum->destroy(lastenum);
DESTROY_IF((certificate_t*)lastcrl);
free(crl_serial.ptr);
if (!crl)
{
@ -442,9 +439,12 @@ error:
DESTROY_IF(private);
DESTROY_IF(ca);
DESTROY_IF(crl);
DESTROY_IF(lastenum);
DESTROY_IF((certificate_t*)lastcrl);
signature_params_destroy(scheme);
free(encoding.ptr);
free(baseCrlNumber.ptr);
free(crl_serial.ptr);
list->destroy_function(list, (void*)revoked_destroy);
cdps->destroy_function(cdps, (void*)x509_cdp_destroy);
if (error)