Skip to content

Commit

Permalink
Add OPENSSL_free to avoid mem leak
Browse files Browse the repository at this point in the history
Signed-off-by: Jiasheng Jiang <jiasheng@purdue.edu>

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from #23955)
  • Loading branch information
JiangJias authored and nhorman committed Apr 1, 2024
1 parent 18a30b5 commit 99fe4c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crypto/store/store_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,10 @@ OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_key_fingerprint(const EVP_MD *digest,
return NULL;

md_size = EVP_MD_get_size(digest);
if (md_size <= 0)
if (md_size <= 0) {
OPENSSL_free(search);
return NULL;
}

if (digest != NULL && len != (size_t)md_size) {
ERR_raise_data(ERR_LIB_OSSL_STORE,
Expand Down

0 comments on commit 99fe4c1

Please sign in to comment.