diff --git a/NEWS b/NEWS index b06b1bf300b..8412c6c2bf4 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ PHP NEWS . Fix memory leak of argument in webPhar. (nielsdos) . Fix memory leak when setAlias() fails. (nielsdos) . Fix memory leak in phar_parse_zipfile() error handling. (nielsdos) + . Fix file descriptor/memory leak when opening central fp fails. (nielsdos) - Random: . Fix Randomizer::__serialize() w.r.t. INDIRECTs. (nielsdos) diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 47a518f53ce..c188d6513ab 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -1417,6 +1417,7 @@ fperror: pass.centralfp = php_stream_fopen_tmpfile(); if (!pass.centralfp) { + php_stream_close(pass.filefp); goto fperror; }