Fix some resource leaks in the apps
[openssl.git] / apps / x509.c
index 05aa5547cd9f34243eb1c4e2d7d62a6510326b43..9e5101259f158bf67920e3bced7b77d407641e64 100644 (file)
@@ -261,6 +261,10 @@ int x509_main(int argc, char **argv)
             CAserial = opt_arg();
             break;
         case OPT_SET_SERIAL:
+            if (sno != NULL) {
+                /* Cannot be supplied twice */
+                goto opthelp;
+            }
             if ((sno = s2i_ASN1_INTEGER(NULL, opt_arg())) == NULL)
                 goto opthelp;
             break;