svn commit: samba r3095 - in branches/SAMBA_4_0/source/lib/ldb: ldb_tdb tests

metze at samba.org metze at samba.org
Wed Oct 20 20:48:35 GMT 2004


Author: metze
Date: 2004-10-20 20:48:31 +0000 (Wed, 20 Oct 2004)
New Revision: 3095

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/lib/ldb&rev=3095&nolog=1

Log:
- fix a free'ing of msg.dn

- reenable index tests

metze 

Modified:
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
   branches/SAMBA_4_0/source/lib/ldb/tests/test-generic.sh


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c	2004-10-20 20:34:32 UTC (rev 3094)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c	2004-10-20 20:48:31 UTC (rev 3095)
@@ -266,7 +266,6 @@
 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);

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2004-10-20 20:34:32 UTC (rev 3094)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2004-10-20 20:48:31 UTC (rev 3095)
@@ -608,7 +608,6 @@
 		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 @@
 
 	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);

Modified: branches/SAMBA_4_0/source/lib/ldb/tests/test-generic.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/tests/test-generic.sh	2004-10-20 20:34:32 UTC (rev 3094)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/test-generic.sh	2004-10-20 20:48:31 UTC (rev 3095)
@@ -17,14 +17,14 @@
 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`



More information about the samba-cvs mailing list