Browse Source

fix mem leak in parsing log config lines

svn:r14202
Roger Dingledine 16 years ago
parent
commit
8dfccf6145
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/common/log.c

+ 6 - 2
src/common/log.c

@@ -839,9 +839,13 @@ parse_log_severity_config(const char **cfg_ptr,
       sev_lo = tor_strndup(cfg, space-cfg);
       sev_hi = tor_strdup("ERR");
     }
-    if ((low = parse_log_level(sev_lo)) == -1)
+    low = parse_log_level(sev_lo);
+    high = parse_log_level(sev_hi);
+    tor_free(sev_lo);
+    tor_free(sev_hi);
+    if (low == -1)
       return -1;
-    if ((high = parse_log_level(sev_hi)) == -1)
+    if (high == -1)
       return -1;
 
     got_anything = 1;