From 1eef28bb673bc899ce30e01b161b4d75ac045cf5 Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Mon, 19 May 2008 18:09:26 +0000 Subject: [PATCH] There's no way for entry to possibly be NULL at the end of write_entry (in fact, there has never been any way for it to be NULL, going all the way back to revision 1.1 of this file), so remove the check and unconditionally free entry. Found by: Coverity Prevent --- usr.bin/tar/write.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c index ec83b6064d6e..8fe0530539c2 100644 --- a/usr.bin/tar/write.c +++ b/usr.bin/tar/write.c @@ -932,8 +932,7 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, const struct stat *st, if (fd >= 0) close(fd); - if (entry != NULL) - archive_entry_free(entry); + archive_entry_free(entry); }