From 927e1636702351d183cd76c8ff34c82c5e80c51f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 5 Jan 2007 21:22:15 +0000 Subject: r20570: use talloc_asprintf() instead of talloc_asprintf_append() because talloc_asprintf_append() doesn't work like talloc_append_string() which uses strlen() on the old string instead of (tc->size - 1) This matter in this case because strlower_talloc() over allocates tridge: how should we fix this in lib/talloc/? metze (This used to be commit 1748af20b1f7b325048619a1e66a1c8b69474c5f) --- source4/libnet/libnet_become_dc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index c5e959f309..97be186f72 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -2151,10 +2151,11 @@ struct composite_context *libnet_BecomeDC_send(struct libnet_context *ctx, TALLO /* Destination DSA dns_name construction */ tmp_name = strlower_talloc(s, s->dest_dsa.netbios_name); if (composite_nomem(tmp_name, c)) return c; - s->dest_dsa.dns_name = talloc_asprintf_append(tmp_name, ".%s", - s->domain.dns_name); + s->dest_dsa.dns_name = talloc_asprintf(s, "%s.%s", + tmp_name, + s->domain.dns_name); + talloc_free(tmp_name); if (composite_nomem(s->dest_dsa.dns_name, c)) return c; - /* Callback function pointers */ s->callbacks = r->in.callbacks; -- cgit