Date: Fri, 28 Dec 2012 12:22:54 -0800 From: Garrett Cooper <yanegomi@gmail.com> To: Baptiste Daroussin <bapt@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r244778 - head/lib/libutil Message-ID: <CAGH67wQ8t1bPt4TxzvTzsfH8DA4vMd_k3%2Bwv08yFEvys=uxxdQ@mail.gmail.com> In-Reply-To: <201212282021.qBSKLEeG096326@svn.freebsd.org> References: <201212282021.qBSKLEeG096326@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 28, 2012 at 12:21 PM, Baptiste Daroussin <bapt@freebsd.org> 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 <christoph.mallon@gmx.de> > > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGH67wQ8t1bPt4TxzvTzsfH8DA4vMd_k3%2Bwv08yFEvys=uxxdQ>