Fix some resource leaks in the apps
[openssl.git] / apps / req.c
index 26661245464c6ca9bea16d233091d270e6f1549b..fb37f7dfecbfa377bf4c7d27095707053dff9637 100644 (file)
@@ -295,6 +295,10 @@ int req_main(int argc, char **argv)
             days = atoi(opt_arg());
             break;
         case OPT_SET_SERIAL:
+            if (serial != NULL) {
+                /* Cannot be supplied twice */
+                goto opthelp;
+            }
             serial = s2i_ASN1_INTEGER(NULL, opt_arg());
             if (serial == NULL)
                 goto opthelp;