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

arma at seul.org arma at seul.org
Wed Mar 26 18:36:46 UTC 2008


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;



More information about the tor-commits mailing list