From: Joerg Sonnenberger Date: Tue, 27 May 2008 13:28:15 +0000 (-0400) Subject: Appease Coverity by checking explicitly if the descriptor is X-Git-Tag: v2.6.0~195 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e236ea1797fae6e7e934c68953a325dbbe1b47b8;p=thirdparty%2Flibarchive.git Appease Coverity by checking explicitly if the descriptor is valid before closing it. SVN-Revision: 97 --- 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;