From 9a72b1c0335aafab334e7d43463db19c24057142 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 28 Sep 2018 13:55:20 +0100 Subject: [PATCH] [Minor] Fix dns errors reporting --- src/lua/lua_dns_resolver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lua/lua_dns_resolver.c b/src/lua/lua_dns_resolver.c index 7c224243e9..061503f2d1 100644 --- a/src/lua/lua_dns_resolver.c +++ b/src/lua/lua_dns_resolver.c @@ -185,8 +185,12 @@ lua_dns_resolver_callback (struct rdns_reply *reply, gpointer arg) lua_pushboolean (L, reply->authenticated); if (lua_pcall (L, 6, 0, err_idx) != 0) { - msg_info_pool_check ("call to dns callback failed: %s", tb->str); - g_string_free (tb, TRUE); + tb = lua_touserdata (L, -1); + + if (tb) { + msg_info_pool_check ("call to dns callback failed: %s", tb->str); + g_string_free (tb, TRUE); + } } lua_settop (L, err_idx - 1); -- 2.47.3