svn commit: samba r20570 - in branches/SAMBA_4_0/source/libnet: .

metze at samba.org metze at samba.org
Fri Jan 5 21:22:16 GMT 2007


Author: metze
Date: 2007-01-05 21:22:15 +0000 (Fri, 05 Jan 2007)
New Revision: 20570

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20570

Log:
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
Modified:
   branches/SAMBA_4_0/source/libnet/libnet_become_dc.c


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/libnet_become_dc.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_become_dc.c	2007-01-05 21:20:11 UTC (rev 20569)
+++ branches/SAMBA_4_0/source/libnet/libnet_become_dc.c	2007-01-05 21:22:15 UTC (rev 20570)
@@ -2151,10 +2151,11 @@
 	/* 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;
 



More information about the samba-cvs mailing list