svn commit: samba r5189 - in branches/SAMBA_4_0/source/lib/ldb/ldb_tdb: .

tridge at samba.org tridge at samba.org
Thu Feb 3 04:03:33 GMT 2005


Author: tridge
Date: 2005-02-03 04:03:28 +0000 (Thu, 03 Feb 2005)
New Revision: 5189

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5189

Log:
fixed a double free bug in the ltdb indexing code

Modified:
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_index.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_index.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_index.c	2005-02-03 04:03:24 UTC (rev 5188)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_index.c	2005-02-03 04:03:28 UTC (rev 5189)
@@ -209,7 +209,6 @@
 			list->dn[list->count] = 
 				talloc_strdup(list->dn, (char *)el->values[j].data);
 			if (!list->dn[list->count]) {
-				talloc_free(list);
 				return -1;
 			}
 			list->count++;
@@ -309,7 +308,6 @@
 
 	if (list->count == 0 || list2->count == 0) {
 		/* 0 & X == 0 */
-		talloc_free(list);
 		return 0;
 	}
 
@@ -320,7 +318,6 @@
 
 	list3->dn = talloc_array(list3, char *, list->count);
 	if (!list3->dn) {
-		talloc_free(list);
 		talloc_free(list3);
 		return -1;
 	}
@@ -359,13 +356,11 @@
 
 	if (list->count == 0 && list2->count == 0) {
 		/* 0 | 0 == 0 */
-		talloc_free(list);
 		return 0;
 	}
 
 	d = talloc_realloc(list, list->dn, char *, list->count + list2->count);
 	if (!d) {
-		talloc_free(list);
 		return -1;
 	}
 	list->dn = d;
@@ -375,7 +370,6 @@
 			      sizeof(char *), (comparison_fn_t)strcmp) == -1) {
 			list->dn[list->count] = talloc_strdup(list->dn, list2->dn[i]);
 			if (!list->dn[list->count]) {
-				talloc_free(list);
 				return -1;
 			}
 			list->count++;
@@ -453,7 +447,6 @@
 	}
 
 	if (list->count == 0) {
-		talloc_free(list);
 		return 0;
 	}
 



More information about the samba-cvs mailing list