diff options
author | Jeremy Allison <jra@samba.org> | 2007-03-01 02:43:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:18:16 -0500 |
commit | 8e00e9d7a6114089fc176bc3446c6c97a01543d6 (patch) | |
tree | 9c5b58be176c12282be1226dd4369cb80a66bb6b /source3/nsswitch | |
parent | fae01b48994fd3168fd921af68dab1b4003adc49 (diff) | |
download | samba-8e00e9d7a6114089fc176bc3446c6c97a01543d6.tar.gz samba-8e00e9d7a6114089fc176bc3446c6c97a01543d6.tar.bz2 samba-8e00e9d7a6114089fc176bc3446c6c97a01543d6.zip |
r21609: Fix memory leaks in error code paths (and one in winbindd_group.c).
Patch from Zack Kirsch <zack.kirsch@isilon.com>.
Jeremy.
(This used to be commit df07a662e32367a52c1e8473475423db2ff5bc51)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/idmap_ldap.c | 3 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_group.c | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/source3/nsswitch/idmap_ldap.c b/source3/nsswitch/idmap_ldap.c index 8cccbcecf4..f74372ecea 100644 --- a/source3/nsswitch/idmap_ldap.c +++ b/source3/nsswitch/idmap_ldap.c @@ -1283,6 +1283,9 @@ static NTSTATUS idmap_ldap_set_mapping(struct idmap_domain *dom, const struct id sid, (unsigned long)map->xid.id, type)); DEBUG(0, ("ldap_set_mapping_internals: Error was: %s (%s)\n", ld_error ? ld_error : "(NULL)", ldap_err2string (rc))); + if (ld_error) { + ldap_memfree(ld_error); + } ret = NT_STATUS_UNSUCCESSFUL; goto done; } diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c index 7edb755f1c..f47d08ee85 100644 --- a/source3/nsswitch/winbindd_group.c +++ b/source3/nsswitch/winbindd_group.c @@ -228,10 +228,12 @@ static BOOL fill_grent_mem(struct winbindd_domain *domain, * from more than one domain, ie aliases. Thus we have to work it out * ourselves in a special routine. */ - if (domain->internal) - return fill_passdb_alias_grmem(domain, group_sid, + if (domain->internal) { + result = fill_passdb_alias_grmem(domain, group_sid, num_gr_mem, gr_mem, gr_mem_len); + goto done; + } if ( !((group_name_type==SID_NAME_DOM_GRP) || ((group_name_type==SID_NAME_ALIAS) && domain->primary)) ) |