mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-04-19 06:08:05 -05:00
fix memory leak
This commit is contained in:
parent
85b0eb6fa0
commit
28904e8d1a
@ -4839,10 +4839,8 @@ static char *find_pvk_key(GLOBAL_OPTIONS *options)
|
|||||||
)
|
)
|
||||||
return NULL; /* FAILED */
|
return NULL; /* FAILED */
|
||||||
btmp = BIO_new_file(options->keyfile, "rb");
|
btmp = BIO_new_file(options->keyfile, "rb");
|
||||||
if (!btmp) {
|
if (!btmp)
|
||||||
printf("Failed to read private key file: %s\n", options->keyfile);
|
|
||||||
return NULL; /* FAILED */
|
return NULL; /* FAILED */
|
||||||
}
|
|
||||||
magic[0] = 0x00;
|
magic[0] = 0x00;
|
||||||
BIO_read(btmp, magic, 4);
|
BIO_read(btmp, magic, 4);
|
||||||
if (!memcmp(magic, pvkhdr, 4)) {
|
if (!memcmp(magic, pvkhdr, 4)) {
|
||||||
@ -5026,6 +5024,8 @@ static void free_crypto_params(CRYPTO_PARAMS *cparams)
|
|||||||
cparams->certs = NULL;
|
cparams->certs = NULL;
|
||||||
sk_X509_pop_free(cparams->xcerts, X509_free);
|
sk_X509_pop_free(cparams->xcerts, X509_free);
|
||||||
cparams->xcerts = NULL;
|
cparams->xcerts = NULL;
|
||||||
|
sk_X509_CRL_pop_free(cparams->crls, X509_CRL_free);
|
||||||
|
cparams->crls = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_options(GLOBAL_OPTIONS *options)
|
static void free_options(GLOBAL_OPTIONS *options)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user