Skip to content

Commit 52555a7

Browse files
committed
- Fixed possible NULL ptr dereference
1 parent b6feabc commit 52555a7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/phar/util.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,8 +1262,10 @@ int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, ch
12621262
spprintf(error, 0, "alias \"%s\" is already used for archive \"%s\" cannot be overloaded with \"%s\"", alias, (*fd_ptr)->fname, fname);
12631263
}
12641264
if (SUCCESS == phar_free_alias(*fd_ptr, alias, alias_len TSRMLS_CC)) {
1265-
efree(*error);
1266-
*error = NULL;
1265+
if (error) {
1266+
efree(*error);
1267+
*error = NULL;
1268+
}
12671269
}
12681270
return FAILURE;
12691271
}

0 commit comments

Comments
 (0)