diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-08-18 07:06:53 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-08-18 07:06:53 +0000 |
commit | 555f8f30f46a5f5e9c5567560255ca8b6ef116e4 (patch) | |
tree | a362b1c04cca431c924bfeb29eec6651ffd4a6a8 /src | |
parent | 285032ce0f66fbd6831686dce6b4e4686703f073 (diff) | |
download | tor-555f8f30f46a5f5e9c5567560255ca8b6ef116e4.tar tor-555f8f30f46a5f5e9c5567560255ca8b6ef116e4.tar.gz |
Avoid segfault when freeing options_t without firewall_ports
svn:r2279
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c index 6d09b7764..e68d7ba5f 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -545,8 +545,10 @@ static void free_options(or_options_t *options) { config_free_lines(options->DirBindAddress); config_free_lines(options->ExitPolicy); config_free_lines(options->SocksPolicy); - SMARTLIST_FOREACH(options->FirewallPorts, char *, cp, tor_free(cp)); - smartlist_free(options->FirewallPorts); + if (options->FirewallPorts) { + SMARTLIST_FOREACH(options->FirewallPorts, char *, cp, tor_free(cp)); + smartlist_free(options->FirewallPorts); + } } /** Set <b>options</b> to hold reasonable defaults for most options. */ |