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:
1
NEWS
1
NEWS
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user