From 7f63cebd331793d059b1dbfd2f7d7ce38105c4fe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Sep 2006 00:10:38 +0000 Subject: r18436: converted ldb to use talloc_move() instead of talloc_steal() when appropriate. Note that I also removed the error checks that were being done on the result of talloc_steal(). They are pointless as talloc_steal() doesn't have any failure modes that wouldn't cause a segv anyway, and they tend to clutter the code (This used to be commit c0d9e7d473b8e3eb2524a9fc29cf88680f994b36) --- source4/lib/ldb/ldb_tdb/ldb_index.c | 8 ++++---- source4/lib/ldb/ldb_tdb/ldb_search.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/lib/ldb/ldb_tdb') diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index b628c31b09..f2816ec1da 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -378,7 +378,7 @@ static int list_intersect(struct ldb_context *ldb, for (i=0;icount;i++) { if (ldb_list_find(list->dn[i], list2->dn, list2->count, sizeof(char *), (comparison_fn_t)strcmp) != -1) { - list3->dn[list3->count] = talloc_steal(list3->dn, list->dn[i]); + list3->dn[list3->count] = talloc_move(list3->dn, list->dn[i]); list3->count++; } else { talloc_free(list->dn[i]); @@ -386,7 +386,7 @@ static int list_intersect(struct ldb_context *ldb, } talloc_free(list->dn); - list->dn = talloc_steal(list, list3->dn); + list->dn = talloc_move(list, list3->dn); list->count = list3->count; talloc_free(list3); @@ -486,7 +486,7 @@ static int ltdb_index_dn_or(struct ldb_module *module, if (ret == -1) { ret = 1; - list->dn = talloc_steal(list, list2->dn); + list->dn = talloc_move(list, list2->dn); list->count = list2->count; } else { if (list_union(ldb, list, list2) == -1) { @@ -567,7 +567,7 @@ static int ltdb_index_dn_and(struct ldb_module *module, if (ret == -1) { ret = 1; talloc_free(list->dn); - list->dn = talloc_steal(list, list2->dn); + list->dn = talloc_move(list, list2->dn); list->count = list2->count; } else { if (list_intersect(ldb, list, list2) == -1) { diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c index 6a35595d52..612ca5c0fe 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_search.c +++ b/source4/lib/ldb/ldb_tdb/ldb_search.c @@ -312,7 +312,7 @@ int ltdb_add_attr_results(struct ldb_module *module, (*res) = res2; - (*res)[*count] = talloc_steal(*res, msg2); + (*res)[*count] = talloc_move(*res, msg2); (*res)[(*count)+1] = NULL; (*count)++; -- cgit