diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-09-30 21:28:00 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-09-30 21:28:00 +0000 |
commit | 5c5d2e82e677ae80e60c7ed1cd2be2c2dbec67c2 (patch) | |
tree | 2ba10c3cd559ec0e65e807369210ae7ab42b3c87 | |
parent | 23864ad423c8be7a2a2d558e47baa8dc122d8de0 (diff) | |
download | tor-5c5d2e82e677ae80e60c7ed1cd2be2c2dbec67c2.tar.gz tor-5c5d2e82e677ae80e60c7ed1cd2be2c2dbec67c2.zip |
Fix a leak when launching listeners.
svn:r5173
-rw-r--r-- | src/or/connection.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 85449b43a4..82f5e82bd6 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -858,12 +858,14 @@ retry_listeners(int type, config_line_t *cfg, line = NULL; SMARTLIST_FOREACH(launch, config_line_t *, wanted, { - char *addr; + char *addr=NULL; uint16_t port; if (! parse_addr_port(wanted->value, &addr, NULL, &port)) { + int addr_matches = !strcasecmp(addr, conn->address); + tor_free(addr); if (! port) port = port_option; - if (port == conn->port && !strcasecmp(addr, conn->address)) { + if (port == conn->port && addr_matches) { line = wanted; break; } |