From owner-svn-src-all@FreeBSD.ORG Fri Dec 28 20:23:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3ACAF137; Fri, 28 Dec 2012 20:23:01 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com [209.85.214.174]) by mx1.freebsd.org (Postfix) with ESMTP id A9B228FC0C; Fri, 28 Dec 2012 20:23:00 +0000 (UTC) Received: by mail-ob0-f174.google.com with SMTP id ta14so9987491obb.19 for ; Fri, 28 Dec 2012 12:22:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=i3iD0zVl/3ZSTj6LIm0yv2RxJwrlXhSKEp/vnY06lA4=; b=xezSGLn17iQAOdvVETirvrk/nHe7ArTcM8+t7AROmv1rj7BQAYQt5o96OwWBdt9t3b OxUDj9sq6pM6H5x2ymK1tHEtTfoFBfdi8QJa3cT6DEKXehHST+ZbqjQtDR7y4NqsLZz4 FrhsNRJ87V8q6o5kzAZF6hsjmfBfrj/2x170c8dBaZk6s4yiuUStPVfphuMMeO06m3IR ETlo/gsva0EcevdfJhWjpu+gMYXWaDjwzqzvU3K0kA+d8LfP7BZ+M1pduRTa14EL8HNm Py0lEXqmhh1hp7EtJQG2hUJSpgR35PcUPvH9/f5obLW7KIhD4q5GVvxnyBcUqkEekKMW 5YCA== MIME-Version: 1.0 Received: by 10.182.172.74 with SMTP id ba10mr28448025obc.83.1356726174762; Fri, 28 Dec 2012 12:22:54 -0800 (PST) Received: by 10.76.143.33 with HTTP; Fri, 28 Dec 2012 12:22:54 -0800 (PST) In-Reply-To: <201212282021.qBSKLEeG096326@svn.freebsd.org> References: <201212282021.qBSKLEeG096326@svn.freebsd.org> Date: Fri, 28 Dec 2012 12:22:54 -0800 Message-ID: Subject: Re: svn commit: r244778 - head/lib/libutil From: Garrett Cooper To: Baptiste Daroussin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2012 20:23:01 -0000 On Fri, Dec 28, 2012 at 12:21 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Fri Dec 28 20:21:14 2012 > New Revision: 244778 > URL: http://svnweb.freebsd.org/changeset/base/244778 > > Log: > malloc() sets errno to ENOMEM already. > > Submitted by: Christoph Mallon > > Modified: > head/lib/libutil/gr_util.c > > Modified: head/lib/libutil/gr_util.c > ============================================================================== > --- head/lib/libutil/gr_util.c Fri Dec 28 20:19:54 2012 (r244777) > +++ head/lib/libutil/gr_util.c Fri Dec 28 20:21:14 2012 (r244778) > @@ -505,17 +505,13 @@ gr_add(struct group *gr, char *newmember > } > /* Allocate enough for current pointers + 1 more and NULL marker */ > mlen = (num_mem + 2) * sizeof(*gr->gr_mem); > - if ((members = malloc(mlen)) == NULL) { > + if ((members = malloc(mlen)) == NULL) > errno = ENOMEM; > - return (NULL); > - } Didn't you mean to remove errno = ENOMEM? Thanks, -Garrett