summaryrefslogtreecommitdiff
path: root/ext/phar/tar.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-06-01 11:58:57 +0300
committerDmitry Stogov <dmitry@zend.com>2018-06-01 11:58:57 +0300
commit0b90cf85a6ace22abd0f9f86d5015a5b6db92387 (patch)
treee01be0712ad1d7dbcd61c81ce03b9544a69e4972 /ext/phar/tar.c
parent9e0f131d2b0e8bf98859c12104a7b0cd8951c135 (diff)
downloadphp-git-0b90cf85a6ace22abd0f9f86d5015a5b6db92387.tar.gz
Removed "dead" code (zend_hash_update() never fails)
Diffstat (limited to 'ext/phar/tar.c')
-rw-r--r--ext/phar/tar.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index d673cc0f68..4241298fe2 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -997,14 +997,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
entry.uncompressed_filesize = phar->alias_len;
- if (NULL == zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
- if (error) {
- spprintf(error, 0, "unable to set alias in tar-based phar \"%s\"", phar->fname);
- }
- php_stream_close(entry.fp);
- efree(entry.filename);
- return EOF;
- }
+ zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info));
/* At this point the entry is saved into the manifest. The manifest destroy
routine will care about any resources to be freed. */
} else {
@@ -1129,14 +1122,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
efree(entry.filename);
}
} else {
- if (NULL == zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
- php_stream_close(entry.fp);
- efree(entry.filename);
- if (error) {
- spprintf(error, 0, "unable to overwrite stub in tar-based phar \"%s\"", phar->fname);
- }
- return EOF;
- }
+ zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info));
}
}
nostub: