Skip to content

Commit 9ce1c23

Browse files
committed
Fix resource leak.
Coverity CID 1635798.
1 parent c4ec8eb commit 9ce1c23

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/zip_close.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,11 +515,13 @@ static int add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t
515515

516516
/* as long as we don't support non-seekable output, clear data descriptor bit */
517517
if ((is_zip64 = _zip_dirent_write(za, de, flags)) < 0) {
518+
zip_source_free(src_final);
518519
return -1;
519520
}
520521

521522
if ((offdata = zip_source_tell_write(za->src)) < 0) {
522523
zip_error_set_from_source(&za->error, za->src);
524+
zip_source_free(src_final);
523525
return -1;
524526
}
525527

0 commit comments

Comments
 (0)