From a34711685b3d17a1e3ec9f3d5069096522ba2a35 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 9 Jun 2015 18:02:29 +0100 Subject: Check DNS resolver return value. --- src/lua/lua_tcp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lua/lua_tcp.c') diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index fadb7d93b..43e8cab7e 100644 --- a/src/lua/lua_tcp.c +++ b/src/lua/lua_tcp.c @@ -610,8 +610,11 @@ lua_tcp_request (lua_State *L) } } else { - make_dns_request (resolver, session, NULL, lua_tcp_dns_handler, cbd, - RDNS_REQUEST_A, host); + if (!make_dns_request (resolver, session, NULL, lua_tcp_dns_handler, cbd, + RDNS_REQUEST_A, host)) { + lua_tcp_push_error (cbd, "cannot resolve host"); + lua_tcp_maybe_free (cbd); + } } lua_pushboolean (L, TRUE); -- cgit v1.2.3