summaryrefslogtreecommitdiff
path: root/source3/smbd/sec_ctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/sec_ctx.c')
-rw-r--r--source3/smbd/sec_ctx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/smbd/sec_ctx.c b/source3/smbd/sec_ctx.c
index f6563ffe96..6f98e9df6b 100644
--- a/source3/smbd/sec_ctx.c
+++ b/source3/smbd/sec_ctx.c
@@ -152,8 +152,10 @@ int get_current_groups(int *p_ngroups, gid_t **p_groups)
return -1;
}
- if ((ngroups = sys_getgroups(ngroups,groups)) == -1)
+ if ((ngroups = sys_getgroups(ngroups,groups)) == -1) {
+ safe_free(groups);
return -1;
+ }
(*p_ngroups) = ngroups;
(*p_groups) = groups;