]> granicus.if.org Git - openssl/commitdiff
Potential memory leak removed. Notified by <threaded@totalise.co.uk>
authorRichard Levitte <levitte@openssl.org>
Thu, 25 Apr 2002 10:10:51 +0000 (10:10 +0000)
committerRichard Levitte <levitte@openssl.org>
Thu, 25 Apr 2002 10:10:51 +0000 (10:10 +0000)
apps/pkcs12.c

index 6789169bdb48dc7d6c31ebad1c09abee42f66f9e..aeba62ea08c9a0c8a4b03f7aa48a4eb568f1f9ba 100644 (file)
@@ -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);