diff options
author | Richard Levitte <levitte@openssl.org> | 2002-04-25 10:10:51 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-04-25 10:10:51 +0000 |
commit | 6b42cad215173a282a194e74f5773e446c9e5299 (patch) | |
tree | 8629325f28c3a10194d5d7085ee44ed82d7a7ce0 /apps | |
parent | 4a34577ec8cf2b7ba31a3421dcb5ebd81e4b1c6c (diff) |
Potential memory leak removed. Notified by <threaded@totalise.co.uk>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/pkcs12.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c index 6789169bdb..aeba62ea08 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -749,7 +749,10 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass, print_attribs (out, bag->attrib, "Bag Attributes"); if (!(p8 = M_PKCS12_decrypt_skey (bag, pass, passlen))) return 0; - if (!(pkey = EVP_PKCS82PKEY (p8))) return 0; + if (!(pkey = EVP_PKCS82PKEY (p8))) { + PKCS8_PRIV_KEY_INFO_free(p8); + return 0; + } print_attribs (out, p8->attributes, "Key Attributes"); PKCS8_PRIV_KEY_INFO_free(p8); PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, pempass); |