[tor-bugs] #5916 [Tor Relay]: memleak in launch_resolve()

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Fri May 18 00:59:23 UTC 2012


#5916: memleak in launch_resolve()
-----------------------+----------------------------------------------------
 Reporter:  asn        |          Owner:                    
     Type:  defect     |         Status:  new               
 Priority:  normal     |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Relay  |        Version:                    
 Keywords:             |         Parent:                    
   Points:             |   Actualpoints:                    
-----------------------+----------------------------------------------------
 `launch_resolve()` leaks `addr` if `DisableNetwork` is set or the
 nameservers can't be configured.

 {{{
 static int
 launch_resolve(edge_connection_t *exitconn)
 {
   char *addr = tor_strdup(exitconn->_base.address);
   struct evdns_request *req = NULL;
   tor_addr_t a;
   int r;
   int options = get_options()->ServerDNSSearchDomains ? 0
     : DNS_QUERY_NO_SEARCH;

   if (get_options()->DisableNetwork)
     return -1;

   /* What? Nameservers not configured?  Sounds like a bug. */
   if (!nameservers_configured) {
     log_warn(LD_EXIT, "(Harmless.) Nameservers not configured, but resolve
 "
              "launched.  Configuring.");
     if (configure_nameservers(1) < 0) {
       return -1;
     }
   }
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/5916>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list