From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 80AE9138350 for ; Sat, 25 Jan 2020 12:20:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 80D15E0831; Sat, 25 Jan 2020 12:20:26 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4AFDFE0831 for ; Sat, 25 Jan 2020 12:20:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EE50934E2E3 for ; Sat, 25 Jan 2020 12:20:24 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BED36ED for ; Sat, 25 Jan 2020 12:20:04 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1579954765.169ad2331b0a84f8a960402b04077ece57bb35e2.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qpkg.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 169ad2331b0a84f8a960402b04077ece57bb35e2 X-VCS-Branch: master Date: Sat, 25 Jan 2020 12:20:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f053bd36-561f-470c-aaca-3a2961ff1cf6 X-Archives-Hash: 5393173e7818fc4b6edddbb417122a0d commit: 169ad2331b0a84f8a960402b04077ece57bb35e2 Author: Fabian Groffen gentoo org> AuthorDate: Sat Jan 25 12:19:25 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat Jan 25 12:19:25 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=169ad233 qpkg: fix Coverity 207883 Error handling issues Signed-off-by: Fabian Groffen gentoo.org> qpkg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qpkg.c b/qpkg.c index 79245d0..14e51ce 100644 --- a/qpkg.c +++ b/qpkg.c @@ -389,7 +389,8 @@ int qpkg_main(int argc, char **argv) if (fchmod(fd, 0750) < 0) errp("could not chmod(0750) temp bindir '%s'", qpkg_bindir); } - close(fd); + if (fd >= 0) + close(fd); /* we have to change to the root so that we can feed the full paths * to tar when we create the binary package. */