Skip to content

Commit 7d3c726

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: phar: Fix memory leak when setAlias() fails
2 parents 3b87850 + 9216b8b commit 7d3c726

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ PHP NEWS
1919

2020
- Phar:
2121
. Fix memory leak of argument in webPhar. (nielsdos)
22+
. Fix memory leak when setAlias() fails. (nielsdos)
2223

2324
- Random:
2425
. Fix Randomizer::__serialize() w.r.t. INDIRECTs. (nielsdos)

ext/phar/phar_object.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2778,6 +2778,7 @@ PHP_METHOD(Phar, setAlias)
27782778
phar_flush(phar_obj->archive, &error);
27792779

27802780
if (error) {
2781+
pefree(phar_obj->archive->alias, phar_obj->archive->is_persistent);
27812782
phar_obj->archive->alias = oldalias;
27822783
phar_obj->archive->alias_len = oldalias_len;
27832784
phar_obj->archive->is_temporary_alias = old_temp;

0 commit comments

Comments
 (0)