Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
}
/* 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);
- }
memcpy(members, gr->gr_mem, num_mem * sizeof(*gr->gr_mem));
members[num_mem++] = newmember;
members[num_mem] = NULL;
gr->gr_mem = members;
newgr = gr_dup(gr);
- if (newgr == NULL)
- errno = ENOMEM;
free(members);
return (newgr);
}