Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7620096ybi; Thu, 1 Aug 2019 10:58:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxMICz1e52J/80PQBmfl6ba4Uv8pjTcnwNJolAS2RKTEI3m+5t9RPmJPUHYGZrymtD17Lj X-Received: by 2002:aa7:82da:: with SMTP id f26mr55218563pfn.82.1564682333547; Thu, 01 Aug 2019 10:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564682333; cv=none; d=google.com; s=arc-20160816; b=HVosHxLLVA+O26oZYbfhe8M1O10vp9oHboQSje5Siq3uch9H+9J8ib4o+b3TN93R5e WzDVn+Y5CfsPsRcXvI/888qwdFT2TsZjeP7ttBmBFhI94j0i92QrLUcYaBeL8ys0iuFw TO8lO60CQ8ZNqOqyiIrcwbQANaJzYJ5Y6zx1yUtDGFfHMDma8Y/BB8JPNkchDL0vTuH+ sV57gRLAufCkVhiOlZid2KsljgDF1p67U+Kd2rbAsbKAKTdHFBO+iqNeapZYxhfj7VBt /Ej3BkIEy1fqNmok4OqCprwsSZoEEQDio2VdGWJXwHKjOjR8HkgZk58ilIhFu4rFAqsD YtNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=U9ByhFQiW7pVu+QwKI93JZkTWjZS2+SATVQTHrwJE2I=; b=FQ6NMpiHVSDPgfrgE39Sc0qfWmE3/pbUFrlznSE5h7ipuDN3GwAA8dIhGs66dp2+FR JvIZPygEj07bjQiLhDGrKEElYc2bNFL2OcyxALF3jsI1NW2hqD/Fj2TY+4AJIL7qlFcC pYCKkh62qyL9aMNuxtIpQE3L0tf5wX0UXQ0ysjanOAAzWmUZyHu0hwU9iHv0wmSVvIef o20Kku3iPoHzk7VjFhvFUpgvUT9sWW/7BbRmDk19SipCWIJyACpGF7++2D0fyYfrK/Mt qDyX9vTGceZjKc4cUA+tyywDaqIUp7dEHTUKPnnEueEYCEAcdE5+BjnbGCU/QQIPZnzD r8Iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si35416371pgv.574.2019.08.01.10.58.37; Thu, 01 Aug 2019 10:58:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732865AbfHAQUx (ORCPT + 99 others); Thu, 1 Aug 2019 12:20:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45360 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731915AbfHAQUx (ORCPT ); Thu, 1 Aug 2019 12:20:53 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90BFD30C2B8B for ; Thu, 1 Aug 2019 16:20:52 +0000 (UTC) Received: from madhat.boston.devel.redhat.com (ovpn-117-78.phx2.redhat.com [10.3.117.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAA2C5E7B5; Thu, 1 Aug 2019 16:20:47 +0000 (UTC) Subject: Re: [PATCH] nfs-utils: Fix memory leak on error in nfs-server-generator To: Alice J Mitchell , linux-nfs@vger.kernel.org References: <1564657141.8625.7.camel@redhat.com> From: Steve Dickson Message-ID: <3543e83f-f79b-2683-6249-4a8c22857852@RedHat.com> Date: Thu, 1 Aug 2019 12:20:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1564657141.8625.7.camel@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 01 Aug 2019 16:20:52 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 8/1/19 6:59 AM, Alice J Mitchell wrote: > Fix the trivial memory leak in the error handling of nfs-server-generator > > Signed-off-by: Alice J Mitchell Committed... steved. > --- > systemd/nfs-server-generator.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/systemd/nfs-server-generator.c b/systemd/nfs-server-generator.c > index 737f109..eec98fd 100644 > --- a/systemd/nfs-server-generator.c > +++ b/systemd/nfs-server-generator.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > > #include "misc.h" > #include "nfslib.h" > @@ -98,7 +99,7 @@ int main(int argc, char *argv[]) > exit(1); > } > > - path = malloc(strlen(argv[1]) + sizeof(dirbase) + sizeof(filebase)); > + path = alloca(strlen(argv[1]) + sizeof(dirbase) + sizeof(filebase)); > if (!path) > exit(2); > if (export_read(_PATH_EXPORTS, 1) + >