Skip to content

Commit

Permalink
fixup! OSSL_PROVIDER_load_ex
Browse files Browse the repository at this point in the history
  • Loading branch information
beldmit committed Aug 3, 2023
1 parent 3514ee7 commit dc6d970
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crypto/provider_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,19 @@ OSSL_PROVIDER *ossl_provider_new_ex(OSSL_LIB_CTX *libctx, const char *name,
for (i = 0; params[i].key != NULL; i++) {
if (params[i].data_type != OSSL_PARAM_UTF8_STRING)
continue;
if (ossl_provider_info_add_parameter(&template, params[i].key,
if (ossl_provider_info_add_parameter(&template, params[i].key,
(char *)params[i].data) <= 0)
return NULL;
}
}

/* provider_new() generates an error, so no need here */
if ((prov = provider_new(name, template.init, template.parameters)) == NULL)
if ((prov = provider_new(name, template.init, template.parameters)) == NULL) {
sk_INFOPAIR_pop_free(template.parameters, infopair_free);
return NULL;
}
/* Parameters are copied, let's free them */
sk_INFOPAIR_pop_free(template.parameters, infopair_free);

prov->libctx = libctx;
#ifndef FIPS_MODULE
Expand Down

0 comments on commit dc6d970

Please sign in to comment.