From e236ea1797fae6e7e934c68953a325dbbe1b47b8 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Tue, 27 May 2008 09:28:15 -0400 Subject: [PATCH] Appease Coverity by checking explicitly if the descriptor is valid before closing it. SVN-Revision: 97 --- libarchive/archive_read_support_format_mtree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c index 72232ed7e..2f4d5563f 100644 --- a/libarchive/archive_read_support_format_mtree.c +++ b/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; -- 2.47.3