Resolves: https://scan5.scan.coverity.com/#/project-view/65138/10222?selectedIssue=
1675327
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29317)
if (!OSSL_PARAM_get_utf8_string(p.output_formats, &val, 0))
return 0;
OPENSSL_free(ctx->output_formats);
- ctx->output_formats = *val != '\0' ? val : NULL;
+ if (*val != '\0') {
+ ctx->output_formats = val;
+ } else {
+ OPENSSL_free(val);
+ ctx->output_formats = NULL;
+ }
}
return 1;