moonbridge
diff moonbridge_io.c @ 102:51ff6ad11677
Added missing freeaddrinfo() call to moonbridge_io.tcpconnect(...) function; Updated documentation regarding blocking DNS lookups of tcpconnect(...)
author | jbe |
---|---|
date | Wed Apr 08 05:26:15 2015 +0200 (2015-04-08) |
parents | df1ab25c6513 |
children | 4f9e4c6109f4 |
line diff
1.1 --- a/moonbridge_io.c Wed Apr 08 05:12:19 2015 +0200 1.2 +++ b/moonbridge_io.c Wed Apr 08 05:26:15 2015 +0200 1.3 @@ -497,6 +497,7 @@ 1.4 hints.ai_flags = AI_ADDRCONFIG; 1.5 errcode = getaddrinfo(host, port, &hints, &res); 1.6 if (errcode) { 1.7 + freeaddrinfo(res); 1.8 if (errcode == EAI_SYSTEM) { 1.9 moonbr_io_errmsg(); 1.10 lua_pushnil(L); 1.11 @@ -520,6 +521,7 @@ 1.12 addrinfo->ai_socktype | SOCK_CLOEXEC | (nonblocking ? SOCK_NONBLOCK : 0), 1.13 addrinfo->ai_protocol 1.14 ); 1.15 + freeaddrinfo(res); 1.16 if (sock < 0) { 1.17 moonbr_io_errmsg(); 1.18 lua_pushnil(L);