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 908FF139085 for ; Thu, 29 Dec 2016 02:25:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8CDE9E0BFF; Thu, 29 Dec 2016 02:25:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 67453E0BFF for ; Thu, 29 Dec 2016 02:25:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 83AC134165B for ; Thu, 29 Dec 2016 02:25:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4977724F6 for ; Thu, 29 Dec 2016 02:25:52 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1482977623.5afabfc0042833b548309a918ad84bbdebfefd05.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qtbz2.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 5afabfc0042833b548309a918ad84bbdebfefd05 X-VCS-Branch: master Date: Thu, 29 Dec 2016 02:25:52 +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-Archives-Salt: 65ba1049-ff8e-48c9-b325-1dcf8e1cde42 X-Archives-Hash: 2dd09480ab5392517ed1910b6241c808 commit: 5afabfc0042833b548309a918ad84bbdebfefd05 Author: Mike Frysinger gentoo org> AuthorDate: Thu Dec 29 02:13:43 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Dec 29 02:13:43 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=5afabfc0 qtbz2: fix leakage of dir_fd via the -d option qtbz2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qtbz2.c b/qtbz2.c index 723ad27..3c2e9f0 100644 --- a/qtbz2.c +++ b/qtbz2.c @@ -353,9 +353,14 @@ int qtbz2_main(int argc, char **argv) warn("Could not decompose '%s'", tbz2); } + /* We have to cleanup all resources as we're used indirectly + * (e.g. via qmerge). + */ free(heap_tbz2); free(heap_xpak); free(heap_tarbz2); + if (dir_fd != AT_FDCWD) + close(dir_fd); return EXIT_SUCCESS; }