From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by dpdk.org (Postfix) with ESMTP id F22A358DD for ; Wed, 7 Jan 2015 23:59:10 +0100 (CET) Received: by mail-pd0-f182.google.com with SMTP id p10so7347919pdj.13 for ; Wed, 07 Jan 2015 14:59:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=cRh2USNfX5EGirsaP4N8NeS3c91FJ0syo4VIKUvHsNY=; b=E7EPs94fjzWPfTcS8UBOR7oexxJGWDjbzgHUTQElkHS+8XiPzNx0nj1f02bgAMd1HG 5DFF+pIOWbJWJX3Bgn0e4+UppvE26/9BRgD9VzKvksuJRLur1glulLner0qk2MjtUBQY mJtdqM+Qv3A1lNjwiHTyPDGq4yzxcD/v3oAzZkForXirLwr9a7Cix8WHSqtmkpG1sAA/ wUYE6NgZWiBq3RI8kd1AIYBp5qEmqYbGEx8miUBh5+yqNjXjqCMqtWBN7Ky/JLp+wtZC f4XDDAn+3FHJseiuz1A3ncX/t/U6kf3R+MDAgXig0W6J2625znIpNaB2Eb2FZbxnAbB6 ua2g== X-Gm-Message-State: ALoCoQlWIN6mSp12EBqyeMOdgUFOmCzON+rvMI0AgNZWPsLy6wKA63yE49YiVIMRE+aKTVVzTpf/ X-Received: by 10.70.34.196 with SMTP id b4mr9531391pdj.120.1420671550033; Wed, 07 Jan 2015 14:59:10 -0800 (PST) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id ts5sm2678506pbc.88.2015.01.07.14.59.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jan 2015 14:59:09 -0800 (PST) Date: Wed, 7 Jan 2015 14:59:00 -0800 From: Stephen Hemminger To: David Marchand Message-ID: <20150107145900.2a139ee6@urahara> In-Reply-To: <1420635809-30976-3-git-send-email-david.marchand@6wind.com> References: <1420635809-30976-1-git-send-email-david.marchand@6wind.com> <1420635809-30976-3-git-send-email-david.marchand@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 2/2] devargs: remove limit on parameters length X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jan 2015 22:59:11 -0000 On Wed, 7 Jan 2015 14:03:29 +0100 David Marchand wrote: > + buf = strdup(devargs_str); > + if (buf == NULL) { > + RTE_LOG(ERR, EAL, "cannot allocate temp memory for devargs\n"); > + goto fail; > + } > + If string is only used in same function you might consider using strdupa() which avoids worrying about freeing in error paths.