Skip to content

Commit 04ceddf

Browse files
committed
zip: Fix leak when zip_fread() fails
1 parent 0f6550d commit 04ceddf

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

ext/zip/php_zip.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2962,6 +2962,7 @@ static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
29622962
buffer = zend_string_safe_alloc(1, len, 0, 0);
29632963
zip_int64_t n = zip_fread(zf, ZSTR_VAL(buffer), ZSTR_LEN(buffer));
29642964
if (n < 1) {
2965+
zip_fclose(zf);
29652966
zend_string_efree(buffer);
29662967
RETURN_EMPTY_STRING();
29672968
}

0 commit comments

Comments
 (0)