Skip to content

Commit

Permalink
Properly free and close when exiting write_hierarchy() on failed
Browse files Browse the repository at this point in the history
archive_read_next_header2().

Fixes #794
  • Loading branch information
mmatuska committed Oct 4, 2016
1 parent 2482dcf commit 024be27
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tar/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,8 @@ write_hierarchy(struct bsdtar *bsdtar, struct archive *a, const char *path)
"%s", archive_error_string(disk));
if (r == ARCHIVE_FATAL || r == ARCHIVE_FAILED) {
bsdtar->return_value = 1;
archive_entry_free(entry);
archive_read_close(disk);
return;
} else if (r < ARCHIVE_WARN)
continue;
Expand Down

0 comments on commit 024be27

Please sign in to comment.