Skip to content

Commit 594285e

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: phar: Fix memory leak when setAlias() fails
2 parents 89399ad + 79b1419 commit 594285e

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
@@ -2773,6 +2773,7 @@ PHP_METHOD(Phar, setAlias)
27732773
phar_flush(phar_obj->archive, &error);
27742774

27752775
if (error) {
2776+
pefree(phar_obj->archive->alias, phar_obj->archive->is_persistent);
27762777
phar_obj->archive->alias = oldalias;
27772778
phar_obj->archive->alias_len = oldalias_len;
27782779
phar_obj->archive->is_temporary_alias = old_temp;

0 commit comments

Comments
 (0)