From 37746b3d9d557f8c603715702d0cf38b4464d7b3 Mon Sep 17 00:00:00 2001 From: tgoodwin Date: Mon, 16 Feb 1998 10:22:04 +0000 Subject: use ealloc(), not malloc() --- which.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'which.c') 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? */ -- cgit v1.2.3