Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#5916 closed defect (fixed)

memleak in launch_resolve()

Reported by: asn Owned by:
Priority: Medium Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

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

Child Tickets

Change History (6)

comment:1 Changed 8 years ago by nickm

Status: newneeds_review

Branch bug5916 in my public repository.

comment:2 Changed 8 years ago by asn

Looks good to me.

Maybe s/namesrever/nameserver in the changes/ file.

comment:3 Changed 8 years ago by ln5

Looks correct to me.

comment:4 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Thanks for the reviews; merging!

comment:5 Changed 7 years ago by nickm

Keywords: tor-relay added

comment:6 Changed 7 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.