Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp692414pxv; Thu, 15 Jul 2021 13:37:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqswOc9X2p8vT9apaYVWLG7Y1w0dVX+S14y/hrE4RVqueETOkfMCZ2saZbrXYbkguZHI9s X-Received: by 2002:a92:d6c9:: with SMTP id z9mr1435495ilp.134.1626381432920; Thu, 15 Jul 2021 13:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626381432; cv=none; d=google.com; s=arc-20160816; b=YCCffWEnW72eRRf8L6mVioaDpR+7PEY3vAMU7VAYrbX6ozXtB4uzZp/QSnp2JimvJP Fm31xoFRIzzZipZoXEGoXQKH1J0K/ggyZkhE3CND368aLoM60dWHUiz5XIRZnxRUXMFs Bd0z06B/Zge88jE7dWU4eh2ZNunv6BVcA5qQa2TW1wkjWK5igGPRrtLe874Oc91axwV6 vh1DczDi22l6qrR9gzg8AFvBhn4lKbn/zXFhB7izsc9ygjM/I+pfI6VKkDCirl9taFQR ZSqZOewdkWVmk2yHYlJ1nxlvTH8c/pdulaYh4CgcV5YC3SBYNXnxmu5jWgjQHMN5b2m3 /Stg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=U0jlEXPzKJAOFJaq0WOZpv87zWrB3JVWIC1hfUDnPOM=; b=eXF8A3OIEaoMQ+u5bgAFCgvFfZ5Ht98gx/TLmu+9UaJIyhxpgAwqyotIAJTJOnLhav F5krCh1JaAi5SNM/cnDk50C8Sdycrgu6LRgjT5swLN9/UfbgmIJsy09/qAvNr0v1AL8w FD37pSk3cDmkjMoRL8eZNQi0mCjFIFePavyYqkGKibZSS8l8C0uMTX+rUh6tfg5WEHbE OyCyRPICQjE7wywRj4shVcNm8lfREpvCDgAV3UDgqSvGZViznSE5khV1r3dFr7YVukRD yfQAlJsyGsZxUVltSI8zKOcz56cXZ3VQoEMeDAI020Zlx/si/rmbQ7x6twIlj3ZEJBkN YfCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k0uqSirn; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z10si6804516ilz.130.2021.07.15.13.37.00; Thu, 15 Jul 2021 13:37:12 -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=@kernel.org header.s=k20201202 header.b=k0uqSirn; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236255AbhGOUjQ (ORCPT + 99 others); Thu, 15 Jul 2021 16:39:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:59590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235972AbhGOUjP (ORCPT ); Thu, 15 Jul 2021 16:39:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9DFD5613D4; Thu, 15 Jul 2021 20:36:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626381381; bh=qWFQ91w7Drwc+LMGTbz4n4hkc/PAiybe38t1z6unfr8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k0uqSirnK8Ds9cxHtJXyhq1iojKOvP0gan/9fqhocybfUeJgKGM00oztlxWRN+1TN lz8oCRz2Kb2E1CdSF1BTLLQCbcnPK2NOxBr0mN4oFRJz+FWolWagjpR58h+L+A/xrf 7/alsDSrGvFMkG6H6CRLJzH0pldXK7uYsHbC809gfHc0TdHj07QXp8JKcql/xagUls LORWHmlMqXFqqH169ru5mHqt9lckp/JbeDwGNDJadaG/sf5tGxd2BkRHqPeZrRG/j9 1wErQoeK9seR92hzctfhZVPw28eqodJeBeuvRK4xqcBFA/J1tHWpDHv88BRqx2hKsa OgxWQghuw8BNg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 5C302403F2; Thu, 15 Jul 2021 17:36:19 -0300 (-03) Date: Thu, 15 Jul 2021 17:36:19 -0300 From: Arnaldo Carvalho de Melo To: Riccardo Mancini Cc: Ian Rogers , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH 18/20] perf trace: free strings in trace__parse_events_option Message-ID: References: <34d08535b11124106b859790549991abff5a7de8.1626343282.git.rickyman7@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <34d08535b11124106b859790549991abff5a7de8.1626343282.git.rickyman7@gmail.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Jul 15, 2021 at 06:07:23PM +0200, Riccardo Mancini escreveu: > ASan reports several memory leaks running the perf test > "88: Check open filename arg using perf trace + vfs_getname". > The fourth of these leaks is related to some strings never being freed > in trace__parse_events_option. > > This patch adds the missing frees. Thanks, applied. - Arnaldo > Signed-off-by: Riccardo Mancini > --- > tools/perf/builtin-trace.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c > index d9c65d55a9ae7526..4a677f3ff273887a 100644 > --- a/tools/perf/builtin-trace.c > +++ b/tools/perf/builtin-trace.c > @@ -4659,6 +4659,9 @@ static int trace__parse_events_option(const struct option *opt, const char *str, > err = parse_events_option(&o, lists[0], 0); > } > out: > + free(strace_groups_dir); > + free(lists[0]); > + free(lists[1]); > if (sep) > *sep = ','; > > -- > 2.31.1 > -- - Arnaldo