[tor-bugs] #18374 [Tor]: Small memory leak on parsing a :auto port configuration

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Feb 22 20:50:54 UTC 2016


#18374: Small memory leak on parsing a :auto port configuration
-------------------------+--------------------------------
     Reporter:  nickm    |      Owner:
         Type:  defect   |     Status:  new
     Priority:  Medium   |  Milestone:  Tor: 0.2.8.x-final
    Component:  Tor      |    Version:
     Severity:  Trivial  |   Keywords:
Actual Points:           |  Parent ID:
       Points:           |    Sponsor:
-------------------------+--------------------------------
 {{{
     } else if (!strcasecmpend(addrport, ":auto")) {
       char *addrtmp = tor_strndup(addrport, strlen(addrport)-5);
       port = CFG_AUTO_PORT;
       if (tor_addr_port_lookup(addrtmp, &addr, &ptmp)<0 || ptmp) {
         log_warn(LD_CONFIG, "Invalid address '%s' for %sPort",
                  escaped(addrport), portname);
         tor_free(addrtmp);
         goto err;
       }
     } else {
 }}}


 On success, nobody frees addrtmp!  Found with asan.

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


More information about the tor-bugs mailing list