r20714: we can use talloc_asprintf_append() again, because strupper_talloc()
authorStefan Metzmacher <metze@samba.org>
Fri, 12 Jan 2007 17:25:43 +0000 (17:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:40:30 +0000 (14:40 -0500)
creates string with the correct memory size without padding zero bytes
at the end

metze

source/libnet/libnet_become_dc.c

index b95aae1fa413509add4f900117b08f44d2e7490a..89c993eb77ee994c074dce2565747ce287292def 100644 (file)
@@ -2154,13 +2154,12 @@ struct composite_context *libnet_BecomeDC_send(struct libnet_context *ctx, TALLO
        if (composite_nomem(s->dest_dsa.netbios_name, c)) return c;
 
        /* Destination DSA dns_name construction */
-       tmp_name                = strlower_talloc(s, s->dest_dsa.netbios_name);
+       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(s, "%s.%s",
-                                                 tmp_name,
-                                                 s->domain.dns_name);
-       talloc_free(tmp_name);
-       if (composite_nomem(s->dest_dsa.dns_name, c)) return c;
+       tmp_name        = talloc_asprintf_append(tmp_name, ".%s",s->domain.dns_name);
+       if (composite_nomem(tmp_name, c)) return c;
+       s->dest_dsa.dns_name    = tmp_name;
+
        /* Callback function pointers */
        s->callbacks = r->in.callbacks;