The coverity detects Resource leak here. It may come to leak when the
option is passed multiple times.
Resolve coverity scan issue
1646846
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27623)
no_header = 1;
break;
case OPT_CONFIG:
+ /*
+ * In case multiple OPT_CONFIG options are passed, we need to free
+ * the previous one before assigning the new one.
+ */
+ OPENSSL_free(configfile);
configfile = OPENSSL_strdup(opt_arg());
break;
case OPT_OUT: