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 355951382C5 for ; Mon, 25 May 2020 11:20:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 058E9E0729; Mon, 25 May 2020 11:20:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 E0A65E0729 for ; Mon, 25 May 2020 11:20:54 +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 98D3134F01B for ; Mon, 25 May 2020 11:20:53 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 17260259 for ; Mon, 25 May 2020 11:20:52 +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: <1590405578.74aeefacd106fcf87e755f2d1a53b0c7bc9f2e10.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/tree.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 74aeefacd106fcf87e755f2d1a53b0c7bc9f2e10 X-VCS-Branch: master Date: Mon, 25 May 2020 11:20: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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ee6eda4c-4d42-4864-9290-276f12666995 X-Archives-Hash: 29d1e6c85fa95d5f15234c2b8ac3eb01 commit: 74aeefacd106fcf87e755f2d1a53b0c7bc9f2e10 Author: Fabian Groffen gentoo org> AuthorDate: Mon May 25 11:19:38 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Mon May 25 11:19:38 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=74aeefac libq/tree: fix Coverity 210534 tree_close_pkg can be called from tree_open_pkg, which will then free the pointer de->d_name, which should only be freed by scandir_free. Signed-off-by: Fabian Groffen gentoo.org> libq/tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libq/tree.c b/libq/tree.c index d313f3b..e4c4eb7 100644 --- a/libq/tree.c +++ b/libq/tree.c @@ -399,6 +399,7 @@ tree_open_pkg(tree_cat_ctx *cat_ctx, const char *name) if (cat_ctx->ctx->query_atom != NULL) { (void)tree_get_atom(pkg_ctx, cat_ctx->ctx->query_atom->SLOT != NULL); if (atom_compare(pkg_ctx->atom, cat_ctx->ctx->query_atom) != EQUAL) { + pkg_ctx->name = NULL; tree_close_pkg(pkg_ctx); return NULL; }