summaryrefslogtreecommitdiff
path: root/source3/groupdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-08-19 18:19:04 +0000
committerJeremy Allison <jra@samba.org>2001-08-19 18:19:04 +0000
commita680611c0bbc77955ce2b7f2c8668915c1b6c3d2 (patch)
treeee0d6a32db51b859dba223ff0df1422005f051ad /source3/groupdb
parent4f14ec2dd1c908be0984dda2dfcafff25e4fe944 (diff)
downloadsamba-a680611c0bbc77955ce2b7f2c8668915c1b6c3d2.tar.gz
samba-a680611c0bbc77955ce2b7f2c8668915c1b6c3d2.tar.bz2
samba-a680611c0bbc77955ce2b7f2c8668915c1b6c3d2.zip
Realloc fixes.
Jeremy. (This used to be commit 6b90263292d03b1ae2d5d18952e78fc26066f30d)
Diffstat (limited to 'source3/groupdb')
-rw-r--r--source3/groupdb/aliasfile.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/source3/groupdb/aliasfile.c b/source3/groupdb/aliasfile.c
index 2735fef38f..fc4489f50e 100644
--- a/source3/groupdb/aliasfile.c
+++ b/source3/groupdb/aliasfile.c
@@ -119,34 +119,29 @@ static char *get_alias_members(char *p, int *num_mem, LOCAL_GRP_MEMBER **members
fstring name;
if (num_mem == NULL || members == NULL)
- {
return NULL;
- }
(*num_mem) = 0;
(*members) = NULL;
- while (next_token(&p, name, ",", sizeof(fstring)))
- {
+ while (next_token(&p, name, ",", sizeof(fstring))) {
LOCAL_GRP_MEMBER *mbrs;
DOM_SID sid;
uint8 type;
- if (lookup_sid(name, &sid, &type))
- {
+ if (lookup_sid(name, &sid, &type)) {
mbrs = Realloc((*members), ((*num_mem)+1) * sizeof(LOCAL_GRP_MEMBER));
(*num_mem)++;
- }
- else
- {
+ } else {
DEBUG(0,("alias database: could not resolve alias named %s\n", name));
continue;
}
- if (mbrs == NULL)
- {
+ if (mbrs == NULL) {
+ if (*members)
+ free(*members);
return NULL;
- }
- else (*members) = mbrs;
+ } else
+ (*members) = mbrs;
fstrcpy((*members)[(*num_mem)-1].name, name);
(*members)[(*num_mem)-1].sid_use = type;