summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-08-23 05:08:55 +0000
committerAndrew Tridgell <tridge@samba.org>2006-08-23 05:08:55 +0000
commit920486ea0010931f39c5dab5fcbe4ca98484bcc1 (patch)
tree58ecff77a63ef93ae74c12895701144894464b62
parent1da5e3d652e56ae28777728dc634c2c937d531a9 (diff)
downloadsamba-920486ea0010931f39c5dab5fcbe4ca98484bcc1.tar.gz
samba-920486ea0010931f39c5dab5fcbe4ca98484bcc1.tar.xz
samba-920486ea0010931f39c5dab5fcbe4ca98484bcc1.zip
r17740: get rid of dependence on asprintf(), using talloc_asprintf() instead
-rw-r--r--source/lib/ldb/tools/ldbedit.c4
-rw-r--r--source/lib/ldb/tools/ldbtest.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/source/lib/ldb/tools/ldbedit.c b/source/lib/ldb/tools/ldbedit.c
index f2cbeedb649..24df98d7287 100644
--- a/source/lib/ldb/tools/ldbedit.c
+++ b/source/lib/ldb/tools/ldbedit.c
@@ -219,7 +219,7 @@ static int do_edit(struct ldb_context *ldb, struct ldb_message **msgs1, int coun
fclose(f);
- asprintf(&cmd, "%s %s", editor, template);
+ cmd = talloc_asprintf(ldb, "%s %s", editor, template);
if (!cmd) {
unlink(template);
@@ -229,7 +229,7 @@ static int do_edit(struct ldb_context *ldb, struct ldb_message **msgs1, int coun
/* run the editor */
ret = system(cmd);
- free(cmd);
+ talloc_free(cmd);
if (ret != 0) {
unlink(template);
diff --git a/source/lib/ldb/tools/ldbtest.c b/source/lib/ldb/tools/ldbtest.c
index 62d8b84061a..98449ae16be 100644
--- a/source/lib/ldb/tools/ldbtest.c
+++ b/source/lib/ldb/tools/ldbtest.c
@@ -225,7 +225,7 @@ static void search_uid(struct ldb_context *ldb, struct ldb_dn *basedn, int nreco
struct ldb_result *res = NULL;
int ret;
- asprintf(&expr, "(uid=TEST%d)", uid);
+ expr = talloc_asprintf(ldb, "(uid=TEST%d)", uid);
ret = ldb_search(ldb, basedn, LDB_SCOPE_SUBTREE, expr, NULL, &res);
if (ret != LDB_SUCCESS || (uid < nrecords && res->count != 1)) {
@@ -242,7 +242,7 @@ static void search_uid(struct ldb_context *ldb, struct ldb_dn *basedn, int nreco
fflush(stdout);
talloc_free(res);
- free(expr);
+ talloc_free(expr);
}
printf("\n");