summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2008-06-15 10:43:59 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2008-06-15 10:43:59 +0000
commitdff2641a6754635e16a6b0f781071f87cfc90272 (patch)
tree01fec4fa0057ea6ab921d6755f50bd532b413c29 /lib
parentc8390967f29572b8a80ff690afbbbf122a570cf0 (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_read_support_format_mtree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_support_format_mtree.c b/lib/libarchive/archive_read_support_format_mtree.c
index 56f9aed06c35..8126f95bfaa3 100644
--- a/lib/libarchive/archive_read_support_format_mtree.c
+++ b/lib/libarchive/archive_read_support_format_mtree.c
@@ -663,7 +663,8 @@ parse_file(struct archive_read *a, struct archive_entry *entry,
*use_next = 1;
}
/* Don't hold a non-regular file open. */
- close(mtree->fd);
+ if (mtree->fd >= 0)
+ close(mtree->fd);
mtree->fd = -1;
st = NULL;
return r;