summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/service.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index b7942906df..8d04ce36e1 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -381,8 +381,12 @@ connection_struct *make_connection(char *service,char *user,char *password, int
conn->vfs_conn->uid = conn->uid;
conn->vfs_conn->gid = conn->gid;
conn->vfs_conn->ngroups = conn->ngroups;
- conn->vfs_conn->groups = (gid_t *)memdup(conn->groups,
- conn->ngroups * sizeof(gid_t));
+ if (conn->vfs_conn->ngroups != 0) {
+ conn->vfs_conn->groups = (gid_t *)memdup(conn->groups,
+ conn->ngroups * sizeof(gid_t));
+ } else {
+ conn->vfs_conn->groups = NULL;
+ }
/* Initialise VFS function pointers */