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

[or-cvs] Fix another memleak. I love you, valgrind!



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv18450/src/or

Modified Files:
	config.c 
Log Message:
Fix another memleak. I love you, valgrind!

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.487
retrieving revision 1.488
diff -u -p -d -r1.487 -r1.488
--- config.c	11 Jan 2006 03:20:53 -0000	1.487
+++ config.c	11 Jan 2006 04:09:40 -0000	1.488
@@ -1673,7 +1673,7 @@ config_dump(config_format_t *fmt, void *
 {
   smartlist_t *elements;
   or_options_t *defaults;
-  config_line_t *line;
+  config_line_t *line, *assigned;
   char *result;
   int i;
   const char *desc;
@@ -1702,7 +1702,7 @@ config_dump(config_format_t *fmt, void *
       smartlist_add(elements, tmp);
     }
 
-    line = get_assigned_option(fmt, options, fmt->vars[i].name);
+    line = assigned = get_assigned_option(fmt, options, fmt->vars[i].name);
     for (; line; line = line->next) {
       size_t len = strlen(line->key) + strlen(line->value) + 3;
       char *tmp;
@@ -1713,7 +1713,7 @@ config_dump(config_format_t *fmt, void *
       }
       smartlist_add(elements, tmp);
     }
-    config_free_lines(line);
+    config_free_lines(assigned);
   }
 
   result = smartlist_join_strings(elements, "", 0, NULL);