From nobody Tue Feb 10 00:58:44 2026 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9AFC18B02; Mon, 5 Feb 2024 10:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707130284; cv=none; b=BQ0VhfDsvyxtGve3b/ILs/m40soq/d016zMtCf0YhBxoDAgC7ZXJ9t39jcfunHlAhbks53YZOWBncr3P68ck91+O997y5sANi7LsJcftxZ6NWfir4Zd2pYIJJ9CDOSXiF7hUnwyuLMnyzcOiEqGtYJi+41fkB74ozgzMLyD7GS4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707130284; c=relaxed/simple; bh=OC9l7go2HEf2topboS2tyvTMicjsAYygRox3AWA4BNs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=d9xprKaDbNptmRGJ3IgtOPyAg39DR8pJ749wqkp/W7AoOwratcqkieqqV7ksTL2chPAD2t61Dkrq4u7/3yTQDUQZV/nyDLImnBu1WTAiVJABzktXkgOT77KEnezyZITDXuqDoIs+uodJ/ECKBLKh7/xkm5yUioop15Pr7KaYoYA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4TT37p4L2GzLnZD; Mon, 5 Feb 2024 18:50:46 +0800 (CST) Received: from kwepemm600003.china.huawei.com (unknown [7.193.23.202]) by mail.maildlp.com (Postfix) with ESMTPS id 3A136140134; Mon, 5 Feb 2024 18:51:15 +0800 (CST) Received: from ubuntu2204.huawei.com (10.67.174.22) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 5 Feb 2024 18:51:14 +0800 From: Yang Jihong To: , , , , , , , , , , CC: Subject: [PATCH 5/5] perf thread_map: Free strlist on normal path in thread_map__new_by_tid_str() Date: Mon, 5 Feb 2024 10:46:16 +0000 Message-ID: <20240205104616.132417-6-yangjihong1@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240205104616.132417-1-yangjihong1@huawei.com> References: <20240205104616.132417-1-yangjihong1@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600003.china.huawei.com (7.193.23.202) Content-Type: text/plain; charset="utf-8" slist needs to be freed in both error path and normal path in thread_map__new_by_tid_str(). Signed-off-by: Yang Jihong Reviewed-by: Arnaldo Carvalho de Melo --- tools/perf/util/thread_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c index e848579e61a8..ea3b431b9783 100644 --- a/tools/perf/util/thread_map.c +++ b/tools/perf/util/thread_map.c @@ -280,13 +280,13 @@ struct perf_thread_map *thread_map__new_by_tid_str(co= nst char *tid_str) threads->nr =3D ntasks; } out: + strlist__delete(slist); if (threads) refcount_set(&threads->refcnt, 1); return threads; =20 out_free_threads: zfree(&threads); - strlist__delete(slist); goto out; } =20 --=20 2.34.1