(net_natt.c) Free net_addrinfo before going out of scope

This commit is contained in:
twinaphex 2017-02-22 05:24:05 +01:00
parent 8eb32fa824
commit ea56249661

View File

@ -99,11 +99,12 @@ static bool natt_open_port(struct natt_status *status,
{
#ifndef HAVE_SOCKET_LEGACY
#if HAVE_MINIUPNPC
int r;
char host[PATH_MAX_LENGTH], ext_host[PATH_MAX_LENGTH],
port_str[6], ext_port_str[6];
const char *proto_str;
struct addrinfo hints = {0}, *ext_addrinfo;
int r;
struct addrinfo hints = {0};
const char *proto_str = NULL;
struct addrinfo *ext_addrinfo = NULL;
/* if NAT traversal is uninitialized or unavailable, oh well */
if (!urls.controlURL || !urls.controlURL[0])
@ -156,6 +157,7 @@ static bool natt_open_port(struct natt_status *status,
return false;
}
freeaddrinfo_retro(ext_addrinfo);
return true;
#else