s4-ldb: fixed a valgrind error in ldbtest
authorAndrew Tridgell <tridge@samba.org>
Fri, 18 Dec 2009 02:07:48 +0000 (13:07 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 18 Dec 2009 10:03:40 +0000 (21:03 +1100)
we were using msg->dn after the ldb it contained had been freed

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/lib/ldb/tools/ldbtest.c

index 6af0ee933633c9283d4c61a18a532bdc985f12b0..adc6ec8115920e4226271b299fce02252420cbaa 100644 (file)
@@ -354,6 +354,8 @@ static void start_test_index(struct ldb_context **ldb)
        }
 
        basedn = ldb_dn_new(*ldb, *ldb, options->basedn);
+       msg->dn = basedn;
+       ldb_dn_add_child_fmt(msg->dn, "cn=test");
 
        ret = ldb_search(*ldb, *ldb, &res, basedn, LDB_SCOPE_SUBTREE, NULL, "uid=test");
        if (ret != LDB_SUCCESS) {