svn commit: r244778 - head/lib/libutil

Baptiste Daroussin bapt at freebsd.org
Fri Dec 28 20:31:32 UTC 2012


On Fri, Dec 28, 2012 at 12:22:54PM -0800, Garrett Cooper wrote:
> On Fri, Dec 28, 2012 at 12:21 PM, Baptiste Daroussin <bapt at 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 at 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?

Thank you, fixed.

Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20121228/c79d60eb/attachment.sig>


More information about the svn-src-all mailing list