瀏覽代碼

stop client_dns_clean from calling malloc(0)

svn:r831
Roger Dingledine 22 年之前
父節點
當前提交
51de02bcb5
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/or/connection_edge.c

+ 2 - 0
src/or/connection_edge.c

@@ -902,6 +902,8 @@ void client_dns_clean(void)
   time_t now;
   int i;
 
+  if(!client_dns_size)
+    return;
   expired_entries = tor_malloc(client_dns_size * 
                                sizeof(struct client_dns_entry *));