Reorder arguments to ldb_search() to match what is in Samba 4.
[kai/samba-autobuild/.git] / source3 / lib / ldb / tools / ldbedit.c
index f8d180495b48c18c10bd39fb7686e5a87e96afb2..dff7270e5d4b240df8178eae07bc3abd66c5a783 100644 (file)
@@ -306,7 +306,7 @@ int main(int argc, const char **argv)
                }
        }
 
-       ret = ldb_search(ldb, basedn, options->scope, expression, attrs, &result);
+       ret = ldb_search(ldb, ldb, &result, basedn, options->scope, attrs, expression);
        if (ret != LDB_SUCCESS) {
                printf("search failed - %s\n", ldb_errstring(ldb));
                exit(1);
@@ -319,12 +319,10 @@ int main(int argc, const char **argv)
 
        do_edit(ldb, result->msgs, result->count, options->editor);
 
-       if (result) {
-               ret = talloc_free(result);
-               if (ret == -1) {
-                       fprintf(stderr, "talloc_free failed\n");
-                       exit(1);
-               }
+       ret = talloc_free(result);
+       if (ret == -1) {
+               fprintf(stderr, "talloc_free failed\n");
+               exit(1);
        }
 
        talloc_free(ldb);