Skip to content

Commit 2fe8527

Browse files
JarneClauwGirgias
authored andcommitted
ext/phar: Fix memory leak in phar_verify_signature() when md_ctx is invalid
Closes GH-21750
1 parent 30f3685 commit 2fe8527

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/phar/util.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s
16401640
if (md_ctx) {
16411641
EVP_MD_CTX_destroy(md_ctx);
16421642
}
1643+
EVP_PKEY_free(key);
16431644
if (error) {
16441645
spprintf(error, 0, "openssl signature could not be verified");
16451646
}

0 commit comments

Comments
 (0)