From fab417e40973e7427a682a95dcbe3ec4ce69ed6e Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Tue, 2 Mar 2004 18:08:07 +0000 Subject: [PATCH] fix a pair of lurking segfaults svn:r1198 --- trunk/src/or/circuit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trunk/src/or/circuit.c b/trunk/src/or/circuit.c index 925e15be94..22a79a7646 100644 --- a/trunk/src/or/circuit.c +++ b/trunk/src/or/circuit.c @@ -65,8 +65,11 @@ void circuit_close_all_marked() global_circuitlist = tmp; } + if(!global_circuitlist) + return; + for (tmp = global_circuitlist; tmp->next; tmp=tmp->next) { - while (tmp->next->marked_for_close) { + while (tmp->next && tmp->next->marked_for_close) { m = tmp->next->next; circuit_free(tmp->next); tmp->next = m;