diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-02-11 16:12:49 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-02-11 16:13:52 -0500 |
commit | afca9ab14ee16b8dcfcde40a13d49f3612138dcb (patch) | |
tree | f7514e9405d7a74e63fe1701b2813b62186b163f /src/or/config.c | |
parent | d3aabf4db176a44d19046b58b99f2edb8c5f49bb (diff) | |
download | tor-afca9ab14ee16b8dcfcde40a13d49f3612138dcb.tar.gz tor-afca9ab14ee16b8dcfcde40a13d49f3612138dcb.zip |
Fix another memory leak
This one occurs when changing configuration options. Found by
coverity.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c index 90a5dfbda1..16eadf917b 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -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); |