[SCM] Samba Shared Repository - branch v3-2-stable updated -
release-3-2-0rc1-42-ga272a3c
Karolin Seeger
kseeger at samba.org
Thu Jun 5 10:32:19 GMT 2008
The branch, v3-2-stable has been updated
via a272a3cc1a2c2b718e8ef6d6b83048de1cdf0a7a (commit)
via 86b55b47e3980d90d9d8cd3ea36b35ef2b10b96c (commit)
from ebc1c20ecb72d0e613a4d3a559e914f887403521 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable
- Log -----------------------------------------------------------------
commit a272a3cc1a2c2b718e8ef6d6b83048de1cdf0a7a
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 5 10:38:58 2008 +0200
Fix a memleak caused by a crappy get_sorted_dc_list() API
(cherry picked from commit ba10b9c077272c521504b3a638bba73446efc61c)
commit 86b55b47e3980d90d9d8cd3ea36b35ef2b10b96c
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 5 10:25:02 2008 +0200
Fix a memleak in ads_find_dc() in case get_sorted_dc_list() fails
This is really not a proper place to fix this, but as get_gc_list() and friends
are about to be replaced anyway, just work around the broken existing API
(cherry picked from commit 6bcfa82ff15531c64e0db27dcc58e5847c513aa6)
-----------------------------------------------------------------------
Summary of changes:
source/libads/ldap.c | 1 +
source/winbindd/winbindd_cm.c | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/libads/ldap.c b/source/libads/ldap.c
index 063645f..7f26d3d 100644
--- a/source/libads/ldap.c
+++ b/source/libads/ldap.c
@@ -319,6 +319,7 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads)
status = get_sorted_dc_list(realm, sitename, &ip_list, &count, got_realm);
if (!NT_STATUS_IS_OK(status)) {
+ SAFE_FREE(ip_list);
/* fall back to netbios if we can */
if ( got_realm && !lp_disable_netbios() ) {
got_realm = False;
diff --git a/source/winbindd/winbindd_cm.c b/source/winbindd/winbindd_cm.c
index 6e1abcf..74cd5db 100644
--- a/source/winbindd/winbindd_cm.c
+++ b/source/winbindd/winbindd_cm.c
@@ -1159,9 +1159,20 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
sitename = sitename_fetch(domain->alt_name);
if (sitename) {
+ NTSTATUS status;
/* Do the site-specific AD dns lookup first. */
- get_sorted_dc_list(domain->alt_name, sitename, &ip_list, &iplist_size, True);
+ status = get_sorted_dc_list(domain->alt_name,
+ sitename, &ip_list,
+ &iplist_size, True);
+ if (!NT_STATUS_IS_OK(status)) {
+ /*
+ * Work around a crappy about-to-be-replaced
+ * get_sorted_dc_list error handling :-)
+ */
+ SAFE_FREE(ip_list);
+ iplist_size = 0;
+ }
for ( i=0; i<iplist_size; i++ ) {
char addr[INET6_ADDRSTRLEN];
@@ -1194,6 +1205,8 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
dcs,
num_dcs);
}
+ SAFE_FREE(ip_list);
+ iplist_size = 0;
}
/* try standard netbios queries if no ADS */
--
Samba Shared Repository
More information about the samba-cvs
mailing list