diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-06-15 10:43:59 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-06-15 10:43:59 +0000 |
commit | bfa1b1945861a658152087251d6468ed8a8fd201 (patch) | |
tree | 01fec4fa0057ea6ab921d6755f50bd532b413c29 /lib/libarchive | |
parent | 43197fcece165924136391beabb2ffbd6cf9ce7a (diff) | |
download | FreeBSD-src-bfa1b1945861a658152087251d6468ed8a8fd201.zip FreeBSD-src-bfa1b1945861a658152087251d6468ed8a8fd201.tar.gz |
Be a little more careful about closing file descriptors that may not exist.
Diffstat (limited to 'lib/libarchive')
-rw-r--r-- | lib/libarchive/archive_read_support_format_mtree.c | 3 |
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 56f9aed..8126f95 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; |