summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/nsstest.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nsswitch/nsstest.c b/nsswitch/nsstest.c
index 39d03424fa..4b3d0a4301 100644
--- a/nsswitch/nsstest.c
+++ b/nsswitch/nsstest.c
@@ -371,6 +371,10 @@ static void nss_test_initgroups(char *name, gid_t gid)
NSS_STATUS status;
groups = (gid_t *)malloc(sizeof(gid_t) * size);
+ if (groups == NULL) {
+ printf("Unable to allocate memory for groups\n");
+ return;
+ }
groups[0] = gid;
status = nss_initgroups(name, gid, &groups, &start, &size);