Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4216076pxj; Mon, 21 Jun 2021 16:47:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYsMPu0ni/EUcPMsZNjeve8yXaAJXscFNqyXiGYqx8Ie5ULFBIyxDES7jMX+DOMdExEPMs X-Received: by 2002:a17:906:ae85:: with SMTP id md5mr666719ejb.93.1624319230509; Mon, 21 Jun 2021 16:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624319230; cv=none; d=google.com; s=arc-20160816; b=W+TWr8CSHZijpaR26FaYInah5Ndc0KLkmwHLgU76m3rEgf7b3KeQ95JxRCRkp4HwFT XsJjbTfAUrk3esqCIlhfx8iBlpgP8vtdy9Fo3UzfsCbj8GEBL2i7fUNAjC3TTWMzVU2U fASpAXLaS7Pjux6mC0mF28OoEWzL73pTJdacoLGdzpEFgtw+qCeVTTB/6t+2uzBjR2af 58LO8886ogMd74ZBxIl14SSgGiZkU35eCfOr972Y7l3u5YzrhmrjkCoxGTjFODPHN4XI EyZjKfQ6nEHwX33bj22Y3MNDIdvTItxF15WGVlYSf5jDq7soJ/NYHryZ8F4s81+tgLxc gmnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LGzFw4/zhJJykqlsIMyi5pwwSFK7n1uyNpDxg53rdIE=; b=sFQy+xPG4u7zzU5Iw1VGbZkSmowa+PjLtXYgpvmgudvfFIA6EFeAg/nyP7Q1AhYZgf SumHaV6Lc7hW6/8erFPqkveutSA0CPZ9VoQEfAVE84pu/pj5/hYVtpSuWGdUT4DoHEJG 4y1HGMJlwqbMNlOlhgqTc2jcOxFZps8fO3oTSUcC555rACYazmGLXfZUqHu2HQAscfEM Sah2yKE73j7gu2R0qoIUP0coRux3wuTdR1EiTYBFL/VganocxUYKWE90MDOpOjjCXtqR nTKcQpUffJnTiOi5ItvXMIsZv60x8A0RvgRfUemwhWBttHxQVPUyGwZRM2PsUcVQeDz8 R96A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QiICc3PC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si10842686edz.18.2021.06.21.16.46.46; Mon, 21 Jun 2021 16:47:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QiICc3PC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232184AbhFUXql (ORCPT + 99 others); Mon, 21 Jun 2021 19:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231722AbhFUXqk (ORCPT ); Mon, 21 Jun 2021 19:46:40 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37EF3C061574; Mon, 21 Jun 2021 16:44:24 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id h21-20020a1ccc150000b02901d4d33c5ca0so1066775wmb.3; Mon, 21 Jun 2021 16:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LGzFw4/zhJJykqlsIMyi5pwwSFK7n1uyNpDxg53rdIE=; b=QiICc3PCdJ+5oWewpbZFf7jOEh9wFeo4QoRSGaVHW5ykY3CtdoTOrCVJ0IaxxzKZkL I1SI5YsVZIBrylNRE679LJr7oex7iMfyh6kM8QVGnLRkIl4sj8UaEB7ebdXtTstlII5g LPZgyXDYMaMgNIE37mOBu7TqnJBIuKi1h5kBF0di5ysM8Tj7L6K6Re0WEQBWaTgQZP56 U4418aOu/Zx+ceAZG0ZuPEl8fw87Pl8pwtp3jvsP/20Cpg6GKiFuozMbD2xbgbkr/41C TYAM+BqFwEafecnlAhE0InsCKX5AMnFfk/f1ke3enwth7E5Yx6xbxOxXqKwZgAcEpWL9 llAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LGzFw4/zhJJykqlsIMyi5pwwSFK7n1uyNpDxg53rdIE=; b=fNkgElk53Gq3jXrW6kfurI9Ryg3dL1afdAcfovVn+u/L6Td1LjcyCh8D0ubD1QT0LX esaK7zINeVK65FA85n9PmAfz7WT1pK5d4dK+Nr9yovSLVgkrmQGgxDEjcx15Q74ffCnV TExliyyV32w9eLQ+hyFZHjYhy6HvFKZK8PHqvKiw5K0v9VgyyjCw9rjiwKeIJRFPtxjr IxWkB1ZTX4XC0G8GD0kALr0kqgvAJqGViRl0PUSw5rYUZdsLqCnZHYmBVdz6YMxFc+Yl wSwAbn4fGWkREELFfas5/h6nKHNHMMcRDN71aisnpAZ0XsMKskFt2+41ILHNiXN04rnm 1WOg== X-Gm-Message-State: AOAM531nVfIhw4+sPGScq4Xh2FTcxTOpRgazjK/r6QVrla6HGArAk99N 7UdG6aJUWwlBa84KmYkBsJ8= X-Received: by 2002:a05:600c:35cb:: with SMTP id r11mr921312wmq.187.1624319062838; Mon, 21 Jun 2021 16:44:22 -0700 (PDT) Received: from honeypot.. ([151.29.45.200]) by smtp.googlemail.com with ESMTPSA id n18sm473130wmq.41.2021.06.21.16.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 16:44:22 -0700 (PDT) From: Riccardo Mancini To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Ian Rogers , Riccardo Mancini , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] perf script: delete evlist when deleting session Date: Tue, 22 Jun 2021 01:43:19 +0200 Message-Id: <20210621234317.235545-3-rickyman7@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621234317.235545-1-rickyman7@gmail.com> References: <20210621234317.235545-1-rickyman7@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ASan reports a memory leak related to session->evlist never being deleted. The evlist member is not deleted in perf_session__delete, so it should be deleted separately. This patch adds the missing deletion in perf-script. Signed-off-by: Riccardo Mancini --- tools/perf/builtin-script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 1280cbfad4db..635a1d9cfc88 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -3991,7 +3991,7 @@ int cmd_script(int argc, const char **argv) zfree(&script.ptime_range); } - evlist__free_stats(session->evlist); + evlist__delete(session->evlist); perf_session__delete(session); if (script_started) -- 2.31.1