瀏覽代碼

Fix a leak in test_have_enough_mem_for_dircache

Nick Mathewson 8 年之前
父節點
當前提交
ba0ddd7467
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/test/test_options.c

+ 2 - 2
src/test/test_options.c

@@ -210,7 +210,7 @@ test_have_enough_mem_for_dircache(void *arg)
 {
 {
   (void)arg;
   (void)arg;
   or_options_t *opt=NULL;
   or_options_t *opt=NULL;
-  or_options_t *dflt;
+  or_options_t *dflt=NULL;
   config_line_t *cl=NULL;
   config_line_t *cl=NULL;
   char *msg=NULL;;
   char *msg=NULL;;
   int r;
   int r;
@@ -292,7 +292,7 @@ test_have_enough_mem_for_dircache(void *arg)
  done:
  done:
   if (msg)
   if (msg)
     tor_free(msg);
     tor_free(msg);
-  tor_free(dflt);
+  or_options_free(dflt);
   or_options_free(opt);
   or_options_free(opt);
   config_free_lines(cl);
   config_free_lines(cl);
   return;
   return;