Skip to content

Commit 79b1419

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: phar: Fix memory leak when setAlias() fails
2 parents 47bec0c + 7d3c726 commit 79b1419

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)