Skip to content

Commit 75426c5

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: phar: Fix file descriptor leak in phar_zip_flush() on failure.
2 parents 0b145f5 + d05f88e commit 75426c5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/phar/zip.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) void phar_zip_flush(phar_archive_data *phar, z
12591259
return;
12601260
}
12611261
if (phar->alias_len != php_stream_write(entry.fp, phar->alias, phar->alias_len)) {
1262+
php_stream_close(entry.fp);
12621263
spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname);
12631264
return;
12641265
}

0 commit comments

Comments
 (0)