summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/phar/util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/phar/util.c b/ext/phar/util.c
index 36e77184f1..5fefb2406d 100644
--- a/ext/phar/util.c
+++ b/ext/phar/util.c
@@ -150,6 +150,9 @@ void phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress
efree(newname);
if (!phar->is_data) {
+ if (phar->alias) {
+ efree(phar->alias);
+ }
phar->alias = estrndup(newpath, strlen(newpath));
phar->alias_len = strlen(newpath);
zend_hash_update(&(PHAR_GLOBALS->phar_alias_map), newpath, strlen(newpath), (void*)&phar, sizeof(phar_archive_data*), NULL);