diff --git a/ext/phar/zip.c b/ext/phar/zip.c index f1d0edd5bdff8..63c56108ed985 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -1246,6 +1246,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int return EOF; } if (phar->alias_len != php_stream_write(entry.fp, phar->alias, phar->alias_len)) { + php_stream_close(entry.fp); if (error) { spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname); }