mirror of
https://github.com/samba-team/samba.git
synced 2025-09-04 09:44:20 +03:00
s3:libads: Allocate all memory on the talloc stackframe
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15016 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
committed by
Günther Deschner
parent
812032833a
commit
652c8ce167
@@ -438,7 +438,7 @@ static char *get_kdc_ip_string(char *mem_ctx,
|
|||||||
|
|
||||||
SMB_ASSERT(pss != NULL);
|
SMB_ASSERT(pss != NULL);
|
||||||
|
|
||||||
kdc_str = talloc_asprintf(mem_ctx,
|
kdc_str = talloc_asprintf(frame,
|
||||||
"\t\tkdc = %s\n",
|
"\t\tkdc = %s\n",
|
||||||
print_canonical_sockaddr_with_port(mem_ctx,
|
print_canonical_sockaddr_with_port(mem_ctx,
|
||||||
pss));
|
pss));
|
||||||
@@ -459,7 +459,7 @@ static char *get_kdc_ip_string(char *mem_ctx,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (sitename) {
|
if (sitename) {
|
||||||
status = get_kdc_list(talloc_tos(),
|
status = get_kdc_list(frame,
|
||||||
realm,
|
realm,
|
||||||
sitename,
|
sitename,
|
||||||
&ip_sa_site,
|
&ip_sa_site,
|
||||||
@@ -477,7 +477,7 @@ static char *get_kdc_ip_string(char *mem_ctx,
|
|||||||
|
|
||||||
/* Get all KDC's. */
|
/* Get all KDC's. */
|
||||||
|
|
||||||
status = get_kdc_list(talloc_tos(),
|
status = get_kdc_list(frame,
|
||||||
realm,
|
realm,
|
||||||
NULL,
|
NULL,
|
||||||
&ip_sa_nonsite,
|
&ip_sa_nonsite,
|
||||||
@@ -589,7 +589,7 @@ static char *get_kdc_ip_string(char *mem_ctx,
|
|||||||
kdc_str = new_kdc_str;
|
kdc_str = new_kdc_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = kdc_str;
|
result = talloc_move(mem_ctx, &kdc_str);
|
||||||
out:
|
out:
|
||||||
if (result != NULL) {
|
if (result != NULL) {
|
||||||
DBG_DEBUG("Returning\n%s\n", kdc_str);
|
DBG_DEBUG("Returning\n%s\n", kdc_str);
|
||||||
@@ -597,8 +597,6 @@ out:
|
|||||||
DBG_NOTICE("Failed to get KDC ip address\n");
|
DBG_NOTICE("Failed to get KDC ip address\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
TALLOC_FREE(ip_sa_site);
|
|
||||||
TALLOC_FREE(ip_sa_nonsite);
|
|
||||||
TALLOC_FREE(frame);
|
TALLOC_FREE(frame);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user