summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-08-22 22:28:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:32 -0500
commit2fe39a82bf3fcd7d9c214151bfaa570f617630f0 (patch)
tree5b76f4010d2ecbb6a893787a2472c5284d2eb457
parentba8ed91a759b41c181f9bffe732f6dd556590674 (diff)
downloadsamba-2fe39a82bf3fcd7d9c214151bfaa570f617630f0.tar.gz
samba-2fe39a82bf3fcd7d9c214151bfaa570f617630f0.tar.bz2
samba-2fe39a82bf3fcd7d9c214151bfaa570f617630f0.zip
r17722: better to use talloc_vasprintf() than vasprintf() directly, as it
depends on less libc functions (This used to be commit a05101d83b06543cd32b08b4dec29d8f6bd27674)
-rw-r--r--source4/lib/ldb/common/ldb_dn.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index 7dfcba0631..a0f48723ab 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -836,19 +836,18 @@ struct ldb_dn *ldb_dn_string_compose(void *mem_ctx, const struct ldb_dn *base, c
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;
}