소스 검색

fix a pair of lurking segfaults

svn:r1198
Roger Dingledine 21 년 전
부모
커밋
4f6cf727b9
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/or/circuit.c

+ 4 - 1
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;