diff options
| author | tgoodwin <tgoodwin> | 1998-02-16 10:22:04 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:03 +0100 |
| commit | 37746b3d9d557f8c603715702d0cf38b4464d7b3 (patch) | |
| tree | 30e40cb1293cc9b629f6f2b1ef672245a3d9c941 /which.c | |
| parent | 5e881721eff63ace43b88082939800eb902c9c35 (diff) | |
use ealloc(), not malloc()
Diffstat (limited to 'which.c')
| -rw-r--r-- | which.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -88,11 +88,8 @@ extern char *which(char *name, bool verbose) { gid = getegid(); #if HAVE_GETGROUPS ngroups = getgroups(0, (GETGROUPS_T *)0); - gidset = malloc(ngroups * sizeof(GETGROUPS_T)); - if (!gidset) - uerror("malloc"); - else - getgroups(ngroups, gidset); + gidset = ealloc(ngroups * sizeof(GETGROUPS_T)); + getgroups(ngroups, gidset); #endif } if (isabsolute(name)) /* absolute pathname? */ |