Fix inet_global_getaddrinfo leak of getnameinfo

Issue #127 closed.
This commit is contained in:
Diego Nehab 2015-02-18 20:54:27 -02:00
parent ddf4292824
commit 76ed24fe8a

View File

@ -183,6 +183,7 @@ static int inet_global_getaddrinfo(lua_State *L)
ret = getnameinfo(iterator->ai_addr, (socklen_t) iterator->ai_addrlen, ret = getnameinfo(iterator->ai_addr, (socklen_t) iterator->ai_addrlen,
hbuf, (socklen_t) sizeof(hbuf), NULL, 0, NI_NUMERICHOST); hbuf, (socklen_t) sizeof(hbuf), NULL, 0, NI_NUMERICHOST);
if (ret){ if (ret){
freeaddrinfo(resolved);
lua_pushnil(L); lua_pushnil(L);
lua_pushstring(L, socket_gaistrerror(ret)); lua_pushstring(L, socket_gaistrerror(ret));
return 2; return 2;