Merge branch 'PHP-7.1'

* PHP-7.1:
  fix erroneous resource destruction
  Sync NEWS
This commit is contained in:
Anatol Belski 2016-09-14 12:09:58 +02:00
commit e3ba3d703b

View file

@ -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);