mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
Merge branch 'PHP-7.1'
* PHP-7.1: fix erroneous resource destruction Sync NEWS
This commit is contained in:
commit
e3ba3d703b
1 changed files with 2 additions and 18 deletions
|
@ -1002,6 +1002,8 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
|
|||
efree(entry.filename);
|
||||
return EOF;
|
||||
}
|
||||
/* At this point the entry is saved into the manifest. The manifest destroy
|
||||
routine will care about any resources to be freed. */
|
||||
} else {
|
||||
zend_hash_str_del(&phar->manifest, ".phar/alias.txt", sizeof(".phar/alias.txt")-1);
|
||||
}
|
||||
|
@ -1015,12 +1017,6 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
|
|||
if (error) {
|
||||
spprintf(error, 0, "unable to access resource to copy stub to new tar-based phar \"%s\"", phar->fname);
|
||||
}
|
||||
if (entry.fp) {
|
||||
php_stream_close(entry.fp);
|
||||
}
|
||||
if (entry.filename) {
|
||||
efree(entry.filename);
|
||||
}
|
||||
return EOF;
|
||||
}
|
||||
if (len == -1) {
|
||||
|
@ -1048,12 +1044,6 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
|
|||
if (error) {
|
||||
spprintf(error, 0, "unable to read resource to copy stub to new tar-based phar \"%s\"", phar->fname);
|
||||
}
|
||||
if (entry.fp) {
|
||||
php_stream_close(entry.fp);
|
||||
}
|
||||
if (entry.filename) {
|
||||
efree(entry.filename);
|
||||
}
|
||||
return EOF;
|
||||
}
|
||||
free_user_stub = 1;
|
||||
|
@ -1070,12 +1060,6 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
|
|||
if (free_user_stub) {
|
||||
efree(user_stub);
|
||||
}
|
||||
if (entry.fp) {
|
||||
php_stream_close(entry.fp);
|
||||
}
|
||||
if (entry.filename) {
|
||||
efree(entry.filename);
|
||||
}
|
||||
return EOF;
|
||||
}
|
||||
pos = user_stub + (pos - tmp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue