svn commit: samba r17722 - in
branches/SAMBA_4_0/source/lib/ldb/common: .
tridge at samba.org
tridge at samba.org
Tue Aug 22 22:28:38 GMT 2006
Author: tridge
Date: 2006-08-22 22:28:37 +0000 (Tue, 22 Aug 2006)
New Revision: 17722
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17722
Log:
better to use talloc_vasprintf() than vasprintf() directly, as it
depends on less libc functions
Modified:
branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c 2006-08-22 22:27:57 UTC (rev 17721)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c 2006-08-22 22:28:37 UTC (rev 17722)
@@ -836,19 +836,18 @@
struct ldb_dn *dn;
char *child_str;
va_list ap;
- int ret;
if (child_fmt == NULL) return NULL;
va_start(ap, child_fmt);
- ret = vasprintf(&child_str, child_fmt, ap);
+ child_str = talloc_vasprintf(mem_ctx, child_fmt, ap);
va_end(ap);
- if (ret <= 0) return NULL;
+ if (child_str == NULL) return NULL;
dn = ldb_dn_compose(mem_ctx, ldb_dn_explode(mem_ctx, child_str), base);
- free(child_str);
+ talloc_free(child_str);
return dn;
}
More information about the samba-cvs
mailing list