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

index 1fbbd6c99f90dad4365c559692e7c3eec9c04734..5d67f19b45522a22e7f4146f0589850ca7dd815d 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);