diff options
Diffstat (limited to 'src/lua/lua_dns_resolver.c')
-rw-r--r-- | src/lua/lua_dns_resolver.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lua/lua_dns_resolver.c b/src/lua/lua_dns_resolver.c index 7eaa54da6..f43267dc6 100644 --- a/src/lua/lua_dns_resolver.c +++ b/src/lua/lua_dns_resolver.c @@ -504,16 +504,18 @@ lua_dns_resolver_resolve_common (lua_State *L, } return 1; + err: + /* Callback is not called in this case */ + if (cbdata->cbref != -1) { + luaL_unref (L, LUA_REGISTRYINDEX, cbdata->cbref); + } + if (!pool) { /* Free resources */ g_free (cbdata->to_resolve); g_free (cbdata->user_str); - } - - /* Callback is not called in this case */ - if (cbdata->cbref != -1) { - luaL_unref (L, LUA_REGISTRYINDEX, cbdata->cbref); + g_free (cbdata); } lua_pushnil (L); |