Filesystem API: Free the archive in _unzip_file_ziparchive()
.
There are several early returns in `_unzip_file_ziparchive()` which don't close the archive prior to returning.
As this function is used in installation and upgrade processes which are memory-intensive, this calls `ZipArchive::close()` to free the archive prior to each early return. This excludes the first return which is a result of a failure to open the archive, which is [https://github.com/nih-at/libzip/blob/main/lib/zip_open.c#L62-L73 freed internally] when the failure occurs.
References:
- PHP.net: [https://www.php.net/manual/en/ziparchive.open.php ZipArchive::open()] and [https://www.php.net/manual/en/ziparchive.close.php ZipArchive::close()]
- libzip: [https://libzip.org/documentation/zip_open.html zip_open()] and [https://libzip.org/documentation/zip_close.html zip_close()]
Follow-up to: [13005], [13006], [13015], [13221], [14346] [25779].
Props azaozz, afragen, joemcgill, costdev.
Fixes #59467
Built from https://develop.svn.wordpress.org/trunk@56735
git-svn-id: http://core.svn.wordpress.org/trunk@56247 1a063a9b-81f0-0310-95a4-ce76da25c4cd