Opened 5 years ago

Closed 5 years ago

#18374 closed defect (fixed)

Small memory leak on parsing a :auto port configuration

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: 0.2.8.x-final
Component: Core Tor/Tor Version:
Severity: Trivial Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

    } 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.

Child Tickets

Change History (1)

comment:1 Changed 5 years ago by nickm

Resolution: fixed
Status: newclosed

bb431ad3dfae6941a0bd615b17283ca8c0a5fe4d has a fix here. Merged.

Note: See TracTickets for help on using tickets.