diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 8c4d80ed1ea..085f9198c61 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -1278,6 +1278,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def return; } 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); }