Fix another memory leak

This one occurs when changing configuration options. Found by
coverity.
This commit is contained in:
Nick Mathewson 2013-02-11 16:12:49 -05:00
parent d3aabf4db1
commit afca9ab14e
1 changed files with 4 additions and 1 deletions

View File

@ -777,9 +777,12 @@ set_options(or_options_t *new_val, char **msg)
line = get_assigned_option(&options_format, new_val, var_name, 1);
if (line) {
for (; line; line = line->next) {
config_line_t *next;
for (; line; line = next) {
next = line->next;
smartlist_add(elements, line->key);
smartlist_add(elements, line->value);
tor_free(line);
}
} else {
smartlist_add(elements, (char*)options_format.vars[i].name);