diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-10-20 20:48:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:02:20 -0500 |
commit | 6d18904b037a39aeff2cad29fb2db84e0d1b2fe4 (patch) | |
tree | 20517cf9f4c97a13f72259dad086d0afc5c012dc | |
parent | 86ab5f126723b3af71506b2f7f43741018b6286a (diff) | |
download | samba-6d18904b037a39aeff2cad29fb2db84e0d1b2fe4.tar.gz samba-6d18904b037a39aeff2cad29fb2db84e0d1b2fe4.tar.bz2 samba-6d18904b037a39aeff2cad29fb2db84e0d1b2fe4.zip |
r3095: - fix a free'ing of msg.dn
- reenable index tests
metze
(This used to be commit 1e7e94fdb10db831090f9bd37e39053dfcde04ce)
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_search.c | 1 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_tdb.c | 3 | ||||
-rwxr-xr-x | source4/lib/ldb/tests/test-generic.sh | 12 |
3 files changed, 8 insertions, 8 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c index a11f137cc9..18d51d1aa4 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_search.c +++ b/source4/lib/ldb/ldb_tdb/ldb_search.c @@ -266,7 +266,6 @@ int ltdb_has_wildcard(struct ldb_context *ldb, const char *attr_name, void ltdb_search_dn1_free(struct ldb_context *ldb, struct ldb_message *msg) { unsigned int i; - ldb_free(ldb, msg->dn); ldb_free(ldb, msg->private_data); for (i=0;i<msg->num_elements;i++) { ldb_free(ldb, msg->elements[i].values); diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c index 934ec68958..3d136ea014 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c @@ -608,7 +608,6 @@ static int ltdb_rename(struct ldb_context *ldb, const char *olddn, const char *n goto failed; } - ldb_free(ldb, msg.dn); msg.dn = ldb_strdup(ldb,newdn); if (!msg.dn) { ltdb_search_dn1_free(ldb, &msg); @@ -617,9 +616,11 @@ static int ltdb_rename(struct ldb_context *ldb, const char *olddn, const char *n ret = ltdb_add(ldb, &msg); if (ret == -1) { + ldb_free(ldb, msg.dn); ltdb_search_dn1_free(ldb, &msg); goto failed; } + ldb_free(ldb, msg.dn); ltdb_search_dn1_free(ldb, &msg); ret = ltdb_delete(ldb, olddn); diff --git a/source4/lib/ldb/tests/test-generic.sh b/source4/lib/ldb/tests/test-generic.sh index a012158de1..b70b817732 100755 --- a/source4/lib/ldb/tests/test-generic.sh +++ b/source4/lib/ldb/tests/test-generic.sh @@ -17,14 +17,14 @@ $VALGRIND bin/ldbrename "$OLDDN" "$NEWDN" || exit 1 echo "Showing renamed record" $VALGRIND bin/ldbsearch '(uid=uham)' || exit 1 -#echo "Starting ldbtest" -#time $VALGRIND bin/ldbtest -r 1000 -s 10 || exit 1 +echo "Starting ldbtest" +time $VALGRIND bin/ldbtest -r 1000 -s 10 || exit 1 -#echo "Adding index" -#$VALGRIND bin/ldbadd tests/test-index.ldif || exit 1 +echo "Adding index" +$VALGRIND bin/ldbadd tests/test-index.ldif || exit 1 -#echo "Starting ldbtest indexed" -#time $VALGRIND bin/ldbtest -r 1000 -s 5000 || exit 1 +echo "Starting ldbtest indexed" +time $VALGRIND bin/ldbtest -r 1000 -s 5000 || exit 1 echo "Testing one level search" count=`$VALGRIND bin/ldbsearch -b 'ou=Groups,o=University of Michigan,c=US' -s one 'objectclass=*' none |grep ^dn | wc -l` |