Plug a memory leak. Spotted by "Shijin" <shijin@comex.com>
authorRichard Levitte <levitte@openssl.org>
Tue, 3 Apr 2001 09:42:36 +0000 (09:42 +0000)
committerRichard Levitte <levitte@openssl.org>
Tue, 3 Apr 2001 09:42:36 +0000 (09:42 +0000)
crypto/pkcs12/p12_kiss.c

index 62272a2d18e9043da29c22b0572f324d9ebd80c7..885087ad00fdbc4c74d0ae95e00b1c0f874ae92d 100644 (file)
@@ -264,6 +264,7 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen,
                if (lkey) {
                        *keymatch |= MATCH_CERT;
                        if (cert) *cert = x509;
+                       else X509_free(x509);
                } else {
                        if(ca) sk_X509_push (*ca, x509);
                        else X509_free(x509);