Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1738590ybn; Thu, 26 Sep 2019 01:13:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCdgknaUWrvzrXfa5f3bpmAth4NTmYCDkBtjqcDt9YEbbZHlbH/exuP6EpSxikTY+0Og3w X-Received: by 2002:a50:cc4d:: with SMTP id n13mr2202925edi.5.1569485629307; Thu, 26 Sep 2019 01:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569485629; cv=none; d=google.com; s=arc-20160816; b=NoizESekKDYSt02dQ1n+tsNbFlwSM90zdKikeps0i7V3ZmQFRG/vs1EHiwzCSU7LLd 1Q2KOt1TudiPOn+7cfLmGfz19XdjG7ptKi4rCXZA2zZVsHqJnzcBLViiVRxxggVbF+GH x04X4RaOZZbN8XzF0MJRGntzRqtZqk++QrliMF9ByUzLDJ2egeB4TPDyXJVkKsvShxEY O5osT3yfCj87FR+MQQnu3nVxB/uGMqexRncvSlGRICLhC5bpU+tVO47JpSdHGXkK8WEo BJsmBVVsmN7FTUdy4M1jSVDlF8D3gvYpbr2+k25e7kHhd/HRdt3rqvJFOBEfttCXYmjT 50bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0xUKH+no17qN4FIPydGfu9Y+l4D9Lb3iuypNg+3CEzA=; b=IAzmC3r1Q6PROTBJoxH1oaWcQmCAj2WSEZup7zIFI1ai+rScIH5RGWJddUTGVac2mk wsc4fjumcG6QiI7lJarz9haEtMCicBVpQxdI6nOuW/tvbBQLRX0FFqedQpsDKByr4O3d csJZ8SrCbPxReqGtoAzCc3qdfcq+vUbrrETGomOOSIoU86Ecghjydew0/eWNiUtugR37 oXfW99PorZOwcNIt3jBXQ5BxisPdaETKMNeWPDS1BmJUoGThB4wOUSDYab3V2drknyHZ /b4cBlZrA2uAJtbWLCnTsehGa/iQtXlfpkqioi8Ph8+FprYlqKe4qaDF4KJ/am0Cs5NE XM0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pk7si593804ejb.216.2019.09.26.01.13.25; Thu, 26 Sep 2019 01:13:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730787AbfIXOI5 (ORCPT + 99 others); Tue, 24 Sep 2019 10:08:57 -0400 Received: from mga17.intel.com ([192.55.52.151]:22247 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729868AbfIXOI5 (ORCPT ); Tue, 24 Sep 2019 10:08:57 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 07:08:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,544,1559545200"; d="scan'208";a="389871041" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by fmsmga006.fm.intel.com with ESMTP; 24 Sep 2019 07:08:56 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 74890301AF5; Tue, 24 Sep 2019 07:08:56 -0700 (PDT) Date: Tue, 24 Sep 2019 07:08:56 -0700 From: Andi Kleen To: Jiri Olsa Cc: Andi Kleen , acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] perf, stat: Fix free memory access / memory leaks in metrics Message-ID: <20190924140856.GQ8537@tassilo.jf.intel.com> References: <20190923233339.25326-1-andi@firstfloor.org> <20190923233339.25326-3-andi@firstfloor.org> <20190924075040.GC26797@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190924075040.GC26797@krava> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > expr__ctx_init(&pctx); > > + /* Must be first id entry */ > > + expr__add_id(&pctx, name, avg); > > hum, shouldn't u instead use strdup(name) instead of name? The cleanup loop later skips freeing the first entry. -Andi