From 03d8666a9a38811b1422f1e30b5c175028c6a5aa Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Tue, 6 Aug 2013 17:25:39 -0400 Subject: Ensure that the grouplist entry array is inited When allocating the array for returning a list of group entries, use calloc() to ensure that the array is zero-filled, in case resizing it fails for some reason. --- src/back-sch-nss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/back-sch-nss.c b/src/back-sch-nss.c index c8aaa20..469e46c 100644 --- a/src/back-sch-nss.c +++ b/src/back-sch-nss.c @@ -431,7 +431,7 @@ repeat: } } while (rc != ngroups); - entries = malloc(sizeof(Slapi_Entry *) * ngroups); + entries = calloc(ngroups, sizeof(Slapi_Entry *)); if (entries == NULL) { free(grouplist); return NULL; -- cgit