Skip to content

Commit 3711a57

Browse files
committed
FIx memory leak in phar_parse_zipfile() error handling
1 parent ab9d121 commit 3711a57

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/phar/zip.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ int phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alia
697697
}
698698
}
699699

700-
if (!entry.uncompressed_filesize || !actual_alias) {
700+
if (!entry.uncompressed_filesize) {
701+
efree(actual_alias);
701702
pefree(entry.filename, entry.is_persistent);
702703
PHAR_ZIP_FAIL("unable to read in alias, truncated");
703704
}

0 commit comments

Comments
 (0)