Avoid a double-free in crl2pl7
authorMatt Caswell <matt@openssl.org>
Tue, 14 Jun 2016 10:27:10 +0000 (11:27 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 14 Jun 2016 10:27:10 +0000 (11:27 +0100)
The variable |crtflst| could get double freed in an error path.

Reviewed-by: Richard Levitte <levitte@openssl.org>
apps/crl2p7.c

index 1631258..9c5f79f 100644 (file)
@@ -84,10 +84,8 @@ int crl2pkcs7_main(int argc, char **argv)
             if ((certflst == NULL)
                 && (certflst = sk_OPENSSL_STRING_new_null()) == NULL)
                 goto end;
-            if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) {
-                sk_OPENSSL_STRING_free(certflst);
+            if (!sk_OPENSSL_STRING_push(certflst, opt_arg()))
                 goto end;
-            }
             break;
         }
     }