From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 461551584AD for ; Sat, 19 Apr 2025 14:06:48 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 100C3340C3C for ; Sat, 19 Apr 2025 14:06:48 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 00D85110494; Sat, 19 Apr 2025 14:06:47 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id EC6E5110494 for ; Sat, 19 Apr 2025 14:06:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7B6AA340C3C for ; Sat, 19 Apr 2025 14:06:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D5B041862 for ; Sat, 19 Apr 2025 14:06:44 +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: <1745071507.ffa327d46b4aa0d02f3e0348103ff9aa5da5eae5.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qmerge.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: ffa327d46b4aa0d02f3e0348103ff9aa5da5eae5 X-VCS-Branch: master Date: Sat, 19 Apr 2025 14:06:44 +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: c9e76783-c856-4f93-a78e-b30f4c0be14c X-Archives-Hash: 879cc96cfeeb3e76207134467b56ea5f commit: ffa327d46b4aa0d02f3e0348103ff9aa5da5eae5 Author: Fabian Groffen gentoo org> AuthorDate: Sat Apr 19 14:05:07 2025 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat Apr 19 14:05:07 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ffa327d4 qmerge: attempt to do list elem free slightly different for Coverity 520177 Looks as if the analysis gets confused by the usage of two vars, so make it more clear we're just saving a pointer to restore. Signed-off-by: Fabian Groffen gentoo.org> qmerge.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qmerge.c b/qmerge.c index 280b0c1..836973c 100644 --- a/qmerge.c +++ b/qmerge.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2024 Gentoo Authors + * Copyright 2005-2025 Gentoo Authors * Distributed under the terms of the GNU General Public License v2 * * Copyright 2005-2010 Ned Ludd - @@ -1749,17 +1749,17 @@ pkg_unmerge(tree_pkg_ctx *pkg_ctx, depend_atom *rpkg, set *keep, /* Then remove all dirs in reverse order */ while (dirs != NULL) { - llist_char *list = dirs; - char *dir = list->data; + llist_char *list; int rm; - rm = pretend ? -1 : rmdir_r_at(portroot_fd, dir + 1); + rm = pretend ? -1 : rmdir_r_at(portroot_fd, dirs->data + 1); qprintf("%s%s%s %s%s%s/\n", rm ? YELLOW : GREEN, rm ? "---" : "<<<", - NORM, DKBLUE, dir, NORM); + NORM, DKBLUE, dirs->data, NORM); - dirs = dirs->next; - free(list->data); - free(list); + list = dirs->next; + free(dirs->data); + free(dirs); + dirs = list; } if (!pretend) {