svn commit: samba r17061 - in branches/SAMBA_4_0/source/lib/talloc: .

metze at samba.org metze at samba.org
Sat Jul 15 13:28:54 GMT 2006


Author: metze
Date: 2006-07-15 13:28:52 +0000 (Sat, 15 Jul 2006)
New Revision: 17061

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

Log:
- remove the currect talloc chunk from it's parent before freeing the children
  this fixes an endless loop bug!
- reenable the test for this

should I merge this to samba3?

metze
Modified:
   branches/SAMBA_4_0/source/lib/talloc/talloc.c
   branches/SAMBA_4_0/source/lib/talloc/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c	2006-07-15 10:55:24 UTC (rev 17060)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c	2006-07-15 13:28:52 UTC (rev 17061)
@@ -585,10 +585,6 @@
 		tc->destructor = NULL;
 	}
 
-	tc->flags |= TALLOC_FLAG_LOOP;
-
-	talloc_free_children(ptr);
-
 	if (tc->parent) {
 		_TLIST_REMOVE(tc->parent->child, tc);
 		if (tc->parent->child) {
@@ -599,8 +595,10 @@
 		if (tc->next) tc->next->prev = tc->prev;
 	}
 
-	tc->flags |= TALLOC_FLAG_FREE;
+	tc->flags |= TALLOC_FLAG_LOOP;
+	talloc_free_children(ptr);
 
+	tc->flags |= TALLOC_FLAG_FREE;
 	old_errno = errno;
 	free(tc);
 	errno = old_errno;

Modified: branches/SAMBA_4_0/source/lib/talloc/testsuite.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/testsuite.c	2006-07-15 10:55:24 UTC (rev 17060)
+++ branches/SAMBA_4_0/source/lib/talloc/testsuite.c	2006-07-15 13:28:52 UTC (rev 17061)
@@ -845,9 +845,8 @@
 	talloc_report_full(top, stdout);
 	talloc_free(top);
 	talloc_free(child_owner);
-#if 0
 	talloc_free(child);
-#endif
+
 	return True;
 }
 



More information about the samba-cvs mailing list