[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] another possible patch related to circuit_free and memory s...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv30730/src/or

Modified Files:
	circuitlist.c 
Log Message:
another possible patch related to circuit_free and memory stomping.

Index: circuitlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/circuitlist.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- circuitlist.c	14 Dec 2005 00:52:15 -0000	1.86
+++ circuitlist.c	14 Dec 2005 18:55:17 -0000	1.87
@@ -280,6 +280,7 @@
   tor_free(circ->onionskin);
   circuit_free_cpath(circ->cpath);
   if (circ->rend_splice) {
+    tor_assert(circ->rend_splice->magic == CIRCUIT_MAGIC);
     circ->rend_splice->rend_splice = NULL;
   }
   /* Remove from map. */
@@ -715,9 +716,11 @@
   circ->marked_for_close = line;
   circ->marked_for_close_file = file;
 
-  if (circ->rend_splice && !circ->rend_splice->marked_for_close) {
-    /* do this after marking this circuit, to avoid infinite recursion. */
-    circuit_mark_for_close(circ->rend_splice);
+  if (circ->rend_splice) {
+    if (!circ->rend_splice->marked_for_close) {
+      /* do this after marking this circuit, to avoid infinite recursion. */
+      circuit_mark_for_close(circ->rend_splice);
+    }
     circ->rend_splice = NULL;
   }
 }