Fix potential memory leak on failure of ecx_gen_init()
When ecx_gen_set_params() returns 0, it could have duplicated the memory for the parameter OSSL_KDF_PARAM_PROPERTIES already in gctx->propq, leading to a memory leak. Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/26015)
This commit is contained in:
parent
d7e8f6f781
commit
98be2e8fb6
@ -510,7 +510,7 @@ static void *ecx_gen_init(void *provctx, int selection,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (!ecx_gen_set_params(gctx, params)) {
|
if (!ecx_gen_set_params(gctx, params)) {
|
||||||
OPENSSL_free(gctx);
|
ecx_gen_cleanup(gctx);
|
||||||
gctx = NULL;
|
gctx = NULL;
|
||||||
}
|
}
|
||||||
return gctx;
|
return gctx;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user