Skip to content
Snippets Groups Projects
Commit 4c4dd505 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Fix a hard-to-trigger memory leak in launch_resolve

To hit this leak, you need to be a relay that gets a RESOLVE request
or an exit node getting a BEGIN or RESOLVE request.  You must either
have unconfigured (and unconfigurable) nameservers, or you must have
somehow set DisableNetwork after a network request arrived but
before you managed to process it.

So, I doubt this is reached often.  Still, a leak's a leak.  Fix for
bug 5916; bugfix on 0.2.3.9-alpha and 0.1.2.1-alpha.
parent c1da29e2
No related branches found
No related tags found
No related merge requests found
o Minor bugfixes:
- Fix a memory leak when trying to launch a DNS request when the
network is disabled or the nameservers are unconfigurable. Fix
for bug 5916; bugfix on Tor 0.1.2.1-alpha (for the
unconfigurable namesrever case) and on 0.2.3.9-alpha (for the
DisableNetwork case).
...@@ -1389,7 +1389,7 @@ evdns_callback(int result, char type, int count, int ttl, void *addresses, ...@@ -1389,7 +1389,7 @@ evdns_callback(int result, char type, int count, int ttl, void *addresses,
static int static int
launch_resolve(edge_connection_t *exitconn) launch_resolve(edge_connection_t *exitconn)
{ {
char *addr = tor_strdup(exitconn->_base.address); char *addr;
struct evdns_request *req = NULL; struct evdns_request *req = NULL;
tor_addr_t a; tor_addr_t a;
int r; int r;
...@@ -1408,6 +1408,8 @@ launch_resolve(edge_connection_t *exitconn) ...@@ -1408,6 +1408,8 @@ launch_resolve(edge_connection_t *exitconn)
} }
} }
addr = tor_strdup(exitconn->_base.address);
r = tor_addr_parse_PTR_name( r = tor_addr_parse_PTR_name(
&a, exitconn->_base.address, AF_UNSPEC, 0); &a, exitconn->_base.address, AF_UNSPEC, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment