1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r17740: get rid of dependence on asprintf(), using talloc_asprintf() instead

This commit is contained in:
Andrew Tridgell 2006-08-23 05:08:55 +00:00 committed by Gerald (Jerry) Carter
parent ceb09f50b7
commit 0e350ea0c1
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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");