diff options
author | Simo Sorce <idra@samba.org> | 2001-08-12 17:30:01 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2001-08-12 17:30:01 +0000 |
commit | 2e783a47076bd0994b6ce86df7ec967bc1c2da63 (patch) | |
tree | c6504d6e8396eef290fe499abb8586b758f1f3d4 /source3/groupdb/aliasdb.c | |
parent | ddec8306586414cc02eca612777bb547cb8dbcae (diff) | |
download | samba-2e783a47076bd0994b6ce86df7ec967bc1c2da63.tar.gz samba-2e783a47076bd0994b6ce86df7ec967bc1c2da63.tar.bz2 samba-2e783a47076bd0994b6ce86df7ec967bc1c2da63.zip |
this is a big global fix for the ptr = Realloc(ptr, size) bug.
many possible mem leaks, and segfaults fixed.
someone should port this fix to 2.2 also.
(This used to be commit fa8e55b8b465114ce209344965c1ca0333b84db9)
Diffstat (limited to 'source3/groupdb/aliasdb.c')
-rw-r--r-- | source3/groupdb/aliasdb.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/groupdb/aliasdb.c b/source3/groupdb/aliasdb.c index a6876d0afc..eed417a699 100644 --- a/source3/groupdb/aliasdb.c +++ b/source3/groupdb/aliasdb.c @@ -140,16 +140,19 @@ LOCAL_GRP *iterate_getaliasnam(char *name, LOCAL_GRP_MEMBER **mem, int *num_mem) *************************************************************************/ BOOL add_domain_alias(LOCAL_GRP **alss, int *num_alss, LOCAL_GRP *als) { + LOCAL_GRP *talss; + if (alss == NULL || num_alss == NULL || als == NULL) { return False; } - (*alss) = Realloc((*alss), ((*num_alss)+1) * sizeof(LOCAL_GRP)); - if ((*alss) == NULL) + talss = Realloc((*alss), ((*num_alss)+1) * sizeof(LOCAL_GRP)); + if (talss == NULL) { return False; } + else (*alss) = talss; DEBUG(10,("adding alias %s(%s)\n", als->name, als->comment)); |