From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81D79C43334 for ; Mon, 20 Jun 2022 20:59:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345611AbiFTU6x (ORCPT ); Mon, 20 Jun 2022 16:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345410AbiFTU6f (ORCPT ); Mon, 20 Jun 2022 16:58:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 235D11C10C for ; Mon, 20 Jun 2022 13:57:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B41EFB8125A for ; Mon, 20 Jun 2022 20:57:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18636C3411B; Mon, 20 Jun 2022 20:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655758634; bh=amNL5hBu8sn0n7Z8DhQo6sxJAIQnP534hLZirq8gRKQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=R+O3zRcSPsojWgjqiFhkA/C+HOp2t4+5MtZS5LPaVjmFIMmHfR/nIVBTxmCXTrtv0 cmD5ffkav7K/4o8skUTn6aefi6fgJp9Eq/uyog3dLaop2ACc78Au3DFwhAJsjM+d2Y QSWiYd4aMJBwW0lyhuodTu0loLxMKtQUiRxcV3Ivc2GN+NsyVkb+b+BrHnEO0njya7 qpbLFC/b7iZFdxkH9f18GhN9uyPaYKd1doAA3iQhb/hrj370OP9CM9PmKjHVYhxW8R mSyivxqMMOa8TCQYf3pZP0p5YpDGhh5lZ6bcMzl0r8qTmI8YOCXt5ghRXhOmGy0Fxh Q1RutzfTDtc7A== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 1D4974096F; Mon, 20 Jun 2022 17:57:11 -0300 (-03) Date: Mon, 20 Jun 2022 17:57:11 -0300 From: Arnaldo Carvalho de Melo To: Adrian Hunter Cc: Jiri Olsa , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf inject: Fix missing free in copy_kcore_dir() Message-ID: References: <20220620103904.7960-1-adrian.hunter@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220620103904.7960-1-adrian.hunter@intel.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Jun 20, 2022 at 01:39:04PM +0300, Adrian Hunter escreveu: > Free string allocated by asprintf(). > > Fixes: d8fc08550929bb ("perf inject: Keep a copy of kcore_dir") > Signed-off-by: Adrian Hunter Thanks, applied. - Arnaldo > --- > tools/perf/builtin-inject.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c > index 42e2918fd1cc..fee9da14afc6 100644 > --- a/tools/perf/builtin-inject.c > +++ b/tools/perf/builtin-inject.c > @@ -891,7 +891,9 @@ static int copy_kcore_dir(struct perf_inject *inject) > if (ret < 0) > return ret; > pr_debug("%s\n", cmd); > - return system(cmd); > + ret = system(cmd); > + free(cmd); > + return ret; > } > > static int output_fd(struct perf_inject *inject) > -- > 2.25.1 -- - Arnaldo