Skip to content

Commit

Permalink
ossl_provider_new(): Fix memory leak on error
Browse files Browse the repository at this point in the history
Fixes #24095

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from #24100)
  • Loading branch information
t8m committed Apr 12, 2024
1 parent 682ed1b commit 875db35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crypto/provider_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,10 @@ OSSL_PROVIDER *ossl_provider_new(OSSL_LIB_CTX *libctx, const char *name,
if (params[i].data_type != OSSL_PARAM_UTF8_STRING)
continue;
if (ossl_provider_info_add_parameter(&template, params[i].key,
(char *)params[i].data) <= 0)
(char *)params[i].data) <= 0) {
sk_INFOPAIR_pop_free(template.parameters, infopair_free);
return NULL;
}
}
}

Expand Down

0 comments on commit 875db35

Please sign in to comment.