Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1357737ybj; Thu, 7 May 2020 22:40:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJI2TAFnMlRsqyqn/gmmHDc7vDGvGrKpsU1iKAQSU93DHfhGdzl8T01YeN651maW7Azsi61 X-Received: by 2002:aa7:c306:: with SMTP id l6mr778856edq.356.1588916441111; Thu, 07 May 2020 22:40:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588916441; cv=none; d=google.com; s=arc-20160816; b=TfsFQWcdssJ8h+4P0XnvoaF8vmdGFLmJxNYQttMfjqFwBQCrXZa+b803D6CpnNhy7E 77CIjk35SyW0iPZr7Fd/lAI6KKpSFRX+vJ56x/WFSLiAtCW6sh8hf/epPWAuZ+8mnHdC 4sKpkd/8h5sB5HZ/0D/y9qNh6ayzranZfo9xlrKiBdZVkgbmRrsdpr9Y+LkWNA0PySiu XCm2Kiyr72dLYA3lgCzsRRhBqbe6IPS61d0pejJX2YqHmZrHBgdDQGmssS17eiY1S1cc 0nnv1r4FAOQrdEUOxXWCxX83Jcxd8ntAGAbu5I0MEmxu6u2w6DhErBbsZHsaIZKvLexr pa2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=C6LPLmrigRmdQi0c0CotlbbH7zK9/A+DlS6KBijVebI=; b=i2YWojKL788I6gG9uqHnG76ikiPkh2iesJsYfqmlI9jR4F3f+wF68v9NWp8c5cJ1Q/ 6VZtItmHGzXwLTShz9Cg2qhELA7II4uK9159h7LXbS9tDush2hxF5O0KwWoMQWVG9IHO PB+eaRojMQa05/f9PDvBAwwR0A9lm8mBHIOwebCeIkGoLcFpqA9lk9j5cbfegFrLzzYB wDZ9Ii6K9bKmVaDlumx/Zikz9k7uLchiS9uk59XXB0RKRYWw357HPA5JsF2RtZ1pBgyJ Z4+xChGDem6fjUMnuT9ARLQ2sRaBYZ+ssecuIVOx5oewc4X3fmnEyQD8x0FPOmKqF2Dp Z6kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="ZqcU//g/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gl22si341305ejb.402.2020.05.07.22.40.18; Thu, 07 May 2020 22:40:41 -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=@google.com header.s=20161025 header.b="ZqcU//g/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727944AbgEHFhp (ORCPT + 99 others); Fri, 8 May 2020 01:37:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727093AbgEHFgp (ORCPT ); Fri, 8 May 2020 01:36:45 -0400 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1818BC05BD43 for ; Thu, 7 May 2020 22:36:45 -0700 (PDT) Received: by mail-qv1-xf4a.google.com with SMTP id g6so702400qvn.3 for ; Thu, 07 May 2020 22:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=C6LPLmrigRmdQi0c0CotlbbH7zK9/A+DlS6KBijVebI=; b=ZqcU//g/tDoNUk+BflT6oxVRhwFNlxaecUArUJq7b6DIuYviS1zPB63htx7eezcWnv mjpi256rFmlq5dECrbtjNuAo6W7/9W97qRDhWvk/nKbZeZYpsO+co+M5QF/9mUbppg48 XVfHhlowBOs3xPub9CpxW8VQpZvurmYGpmzyFjYP6PXjdUNUSJjdYiVK16CmocfntkYk JUT3A/QV3R67vbvQsIEnGOQ8aj8juzWJ7sVOsPuY0Fvb02PNZirKIl2PmOLAUK93sHD/ AD+d2efAnrJLmjgIxB6FUgkBXgPtdQv89cIqHhLsKdrA9woImewcPZ9LUMgB91xGexb4 LzVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=C6LPLmrigRmdQi0c0CotlbbH7zK9/A+DlS6KBijVebI=; b=bQDAk7vRClh9gMeUi7IpwoQAHqz8v/zfSuO5nTtW9cr0CUESSSdMDBjbacg6QMeoqh 4z+yb/weVwAX49TPWUjt8A3P5Buza2AXWyivg4omJuL8SICeH7rCLYqZ4HF6aRqEfhmg DvyulV6vqjxDTkckf2JIFrakbeXuicXxnPSE+tYJJ+uC5qfA6uWI565FXCELGc7bw7Nq 9LAWip1SooGFVRMWklORrVB/7LA9FK1enP75UQB9SmRwyhA14avAcX+Buhx3i1RC7IZo R/tKScgzWiYGEBZhJWlGihkYh0btBdom21u9oZtIoTA7zeNwUmWA+Qsvm4kF6B+4m9cH s/fw== X-Gm-Message-State: AGi0PubqlBL0AcK0Zt1nuiAG5Xl+kEa9y92+DV05Jbudk+cOy+LLqCie 5VcRVViFNbSVJncC4RGYmPSv8fIwzYB6 X-Received: by 2002:a05:6214:1462:: with SMTP id c2mr1086669qvy.202.1588916204234; Thu, 07 May 2020 22:36:44 -0700 (PDT) Date: Thu, 7 May 2020 22:36:21 -0700 In-Reply-To: <20200508053629.210324-1-irogers@google.com> Message-Id: <20200508053629.210324-7-irogers@google.com> Mime-Version: 1.0 References: <20200508053629.210324-1-irogers@google.com> X-Mailer: git-send-email 2.26.2.645.ge9eca65c58-goog Subject: [RFC PATCH v3 06/14] perf evsel: fix 2 memory leaks From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Kajol Jain , Andi Kleen , John Garry , Jin Yao , Kan Liang , Cong Wang , Kim Phillips , linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, Vince Weaver , Stephane Eranian , Ian Rogers Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If allocated, perf_pkg_mask and metric_events need freeing. Signed-off-by: Ian Rogers --- tools/perf/util/evsel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 28683b0eb738..05bb46baad6a 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1263,6 +1263,8 @@ void evsel__exit(struct evsel *evsel) zfree(&evsel->group_name); zfree(&evsel->name); zfree(&evsel->pmu_name); + zfree(&evsel->per_pkg_mask); + zfree(&evsel->metric_events); perf_evsel__object.fini(evsel); } -- 2.26.2.645.ge9eca65c58-goog