diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-01-23 13:08:14 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-01-23 13:08:14 +1100 |
commit | 39d172bf34d0cbb3bf3e3a04d534876097cdccb5 (patch) | |
tree | 3a32fd867e34c9a86c3a2f01308445b76bf2d50c /source3/winbindd/winbindd_cm.c | |
parent | 2caa0e82f5ff2f45a5c912c624e54c4a43f0c3cc (diff) | |
parent | 9051199e40dec27d3532fbec7f5744033def1874 (diff) | |
download | samba-39d172bf34d0cbb3bf3e3a04d534876097cdccb5.tar.gz samba-39d172bf34d0cbb3bf3e3a04d534876097cdccb5.tar.bz2 samba-39d172bf34d0cbb3bf3e3a04d534876097cdccb5.zip |
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
(This used to be commit bc2973df8504850a40cb0a1172689dc0bdafa323)
Diffstat (limited to 'source3/winbindd/winbindd_cm.c')
-rw-r--r-- | source3/winbindd/winbindd_cm.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 908228717e..ef159f0670 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -613,7 +613,13 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain, DS_RETURN_DNS_NAME, &domain_info); if (W_ERROR_IS_OK(werr)) { - fstrcpy(tmp, domain_info->domain_controller_name); + tmp = talloc_strdup( + mem_ctx, domain_info->domain_controller_name); + if (tmp == NULL) { + DEBUG(0, ("talloc_strdup failed\n")); + talloc_destroy(mem_ctx); + return false; + } if (strlen(domain->alt_name) == 0) { fstrcpy(domain->alt_name, domain_info->domain_name); @@ -635,11 +641,10 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain, /* And restore our original timeout. */ cli_set_timeout(netlogon_pipe->cli, orig_timeout); - talloc_destroy(mem_ctx); - if (!W_ERROR_IS_OK(werr)) { DEBUG(10, ("rpccli_netlogon_getanydcname failed: %s\n", dos_errstr(werr))); + talloc_destroy(mem_ctx); return False; } @@ -654,6 +659,8 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain, fstrcpy(dcname, p); + talloc_destroy(mem_ctx); + DEBUG(10, ("rpccli_netlogon_getanydcname returned %s\n", dcname)); if (!resolve_name(dcname, dc_ss, 0x20)) { |