summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/groupdb/groupdb.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/groupdb/groupdb.c b/source3/groupdb/groupdb.c
index 4b7795c57b..227d63e8e3 100644
--- a/source3/groupdb/groupdb.c
+++ b/source3/groupdb/groupdb.c
@@ -141,16 +141,15 @@ BOOL add_domain_group(DOMAIN_GRP **grps, int *num_grps, DOMAIN_GRP *grp)
DOMAIN_GRP *tgrps;
if (grps == NULL || num_grps == NULL || grp == NULL)
- {
return False;
- }
tgrps = Realloc((*grps), ((*num_grps)+1) * sizeof(DOMAIN_GRP));
- if (tgrps == NULL)
- {
+ if (tgrps == NULL) {
+ if (*grps)
+ free(*grps);
return False;
- }
- else (*grps) = tgrps;
+ } else
+ (*grps) = tgrps;
DEBUG(10,("adding group %s(%s)\n", grp->name, grp->comment));