summaryrefslogtreecommitdiffstats
path: root/apps/pkcs12.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-04-25 10:11:21 +0000
committerRichard Levitte <levitte@openssl.org>2002-04-25 10:11:21 +0000
commit6991bf196c277f99ed654869990dbbc1b16aeb80 (patch)
treecbaf3d504d8672578ced590312c71f10d84b5575 /apps/pkcs12.c
parent822a4c1bdb475787a4b9dcf392e214f47db33e87 (diff)
Potential memory leak removed. Notified by <threaded@totalise.co.uk>
Diffstat (limited to 'apps/pkcs12.c')
-rw-r--r--apps/pkcs12.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index 1f5a456947..e345cf1489 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -779,7 +779,10 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
print_attribs (out, bag->attrib, "Bag Attributes");
if (!(p8 = 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);