[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r14202: fix mem leak in parsing log config lines (tor/trunk/src/common)



Author: arma
Date: 2008-03-26 14:36:46 -0400 (Wed, 26 Mar 2008)
New Revision: 14202

Modified:
   tor/trunk/src/common/log.c
Log:
fix mem leak in parsing log config lines


Modified: tor/trunk/src/common/log.c
===================================================================
--- tor/trunk/src/common/log.c	2008-03-26 17:50:27 UTC (rev 14201)
+++ tor/trunk/src/common/log.c	2008-03-26 18:36:46 UTC (rev 14202)
@@ -839,9 +839,13 @@
       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;