uwrap: Use calloc to allocate groups array
authorAndreas Schneider <asn@samba.org>
Thu, 27 Jul 2017 13:55:58 +0000 (15:55 +0200)
committerAndreas Schneider <asn@samba.org>
Mon, 31 Jul 2017 07:45:09 +0000 (09:45 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
src/uid_wrapper.c

index cb31c5e8b009e25812959972f870845e6004019d..b3d12c570278a059b8ea036ed2582d6c2555e06a 100644 (file)
@@ -749,7 +749,7 @@ static int uwrap_pthread_create(pthread_t *thread,
 
        UWRAP_LOCK(uwrap_id);
 
-       args->id->groups = malloc(sizeof(gid_t) * src_id->ngroups);
+       args->id->groups = calloc(src_id->ngroups, sizeof(gid_t));
        if (args->id->groups == NULL) {
                UWRAP_UNLOCK(uwrap_id);
                SAFE_FREE(args->id);