]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Properly call archive_read_close() after archive_read_disk_open().
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 28 Feb 2012 08:28:16 +0000 (17:28 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 28 Feb 2012 08:28:16 +0000 (17:28 +0900)
tar/write.c

index 521e2770f86208c326d08fa967294e74a2002774..273fdda3bd9f2d95cff755e39163819419581439 100644 (file)
@@ -515,12 +515,15 @@ write_archive(struct archive *a, struct bsdtar *bsdtar)
                            "%s", archive_error_string(disk));
                        if (r == ARCHIVE_FATAL)
                                bsdtar->return_value = 1;
+                       else
+                               archive_read_close(disk);
                        archive_entry_free(entry);
                        continue;
                }
 
                write_file(bsdtar, a, entry);
                archive_entry_free(entry);
+               archive_read_close(disk);
                entry = NULL;
                archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry);
        }