summaryrefslogtreecommitdiff
path: root/which.c
diff options
context:
space:
mode:
authortgoodwin <tgoodwin>1998-02-16 10:22:04 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:03 +0100
commit37746b3d9d557f8c603715702d0cf38b4464d7b3 (patch)
tree30e40cb1293cc9b629f6f2b1ef672245a3d9c941 /which.c
parent5e881721eff63ace43b88082939800eb902c9c35 (diff)
use ealloc(), not malloc()
Diffstat (limited to 'which.c')
-rw-r--r--which.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/which.c b/which.c
index e9ec44c..9fe74d5 100644
--- a/which.c
+++ b/which.c
@@ -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? */