From: Richard Levitte Date: Thu, 25 Apr 2002 10:11:08 +0000 (+0000) Subject: Potential memory leak removed. Notified by X-Git-Tag: OpenSSL_0_9_7-beta1~83 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b23b3272dccdf9d0ed6f97c13d16354717448d78;p=oweals%2Fopenssl.git Potential memory leak removed. Notified by --- 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);