瀏覽代碼

Now that we can hit the end of router_rebuild_store before chunk_list is set, we need to test it before freeing it.

svn:r18101
Nick Mathewson 15 年之前
父節點
當前提交
6bf5d49b8a
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/or/routerlist.c

+ 4 - 2
src/or/routerlist.c

@@ -749,8 +749,10 @@ router_rebuild_store(int flags, desc_store_t *store)
     smartlist_free(signed_descriptors);
   tor_free(fname);
   tor_free(fname_tmp);
-  SMARTLIST_FOREACH(chunk_list, sized_chunk_t *, c, tor_free(c));
-  smartlist_free(chunk_list);
+  if (chunk_list) {
+    SMARTLIST_FOREACH(chunk_list, sized_chunk_t *, c, tor_free(c));
+    smartlist_free(chunk_list);
+  }
 
   return r;
 }