Skip to content

Commit 9aef6eb

Browse files
committed
ext/phar: avoid redundant allocation by using zend_string for alias
1 parent ead31bd commit 9aef6eb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ext/phar/phar_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ static const spl_other_handler phar_spl_foreign_handler = {
10721072
PHP_METHOD(Phar, __construct)
10731073
{
10741074
char *fname, *error, *save_fname;
1075-
size_t fname_len, alias_len = 0;
1075+
size_t fname_len;
10761076
bool is_data;
10771077
zend_long flags = SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS;
10781078
zend_long format = 0;

ext/phar/tar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) int phar_tar_flush(phar_archive_data *phar, ze
10491049
}
10501050

10511051
/* set alias */
1052-
if (!phar->is_temporary_alias && phar) {
1052+
if (phar && !phar->is_temporary_alias) {
10531053
entry.fp = php_stream_fopen_tmpfile();
10541054
if (entry.fp == NULL) {
10551055
*error = estrdup("phar error: unable to create temporary file");

0 commit comments

Comments
 (0)