From d0fc1675df35e65488a19d7f5929792fba347b07 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Apr 2000 08:28:49 +0000 Subject: don't copy a null groups list --- source/smbd/service.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/smbd/service.c b/source/smbd/service.c index b7942906dff..8d04ce36e10 100644 --- a/source/smbd/service.c +++ b/source/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 */ -- cgit