1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

phar: Fix memory leak when setAlias() fails

Closes GH-20135.
This commit is contained in:
Niels Dossche
2025-10-11 13:08:29 +02:00
parent da39975001
commit 9216b8be8b
2 changed files with 2 additions and 0 deletions

1
NEWS
View File

@@ -17,6 +17,7 @@ PHP NEWS
- Phar:
. Fix memory leak of argument in webPhar. (nielsdos)
. Fix memory leak when setAlias() fails. (nielsdos)
- Random:
. Fix Randomizer::__serialize() w.r.t. INDIRECTs. (nielsdos)

View File

@@ -2770,6 +2770,7 @@ valid_alias:
phar_flush(phar_obj->archive, NULL, 0, 0, &error);
if (error) {
pefree(phar_obj->archive->alias, phar_obj->archive->is_persistent);
phar_obj->archive->alias = oldalias;
phar_obj->archive->alias_len = oldalias_len;
phar_obj->archive->is_temporary_alias = old_temp;