Resolves: https://scan5.scan.coverity.com/#/project-view/62622/10222?selectedIssue=
1684201
Complements: #
adc8e4abd96 Fix Memory leak in app_passwd
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Mar 12 11:34:53 2026
(Merged from https://github.com/openssl/openssl/pull/30365)
if (arg2 != NULL) {
*pass2 = app_get_pass(arg2, same ? 2 : 0);
if (*pass2 == NULL) {
- clear_free(*pass1);
- *pass1 = NULL;
+ if (pass1 != NULL) {
+ clear_free(*pass1);
+ *pass1 = NULL;
+ }
return 0;
}
} else if (pass2 != NULL) {