lua_http_request (lua_State *L)
{
const gchar *url, *lua_body;
+ gchar *to_resolve;
gint cbref;
gsize bodylen;
struct event_base *ev_base;
}
else {
if (task == NULL) {
+ to_resolve = g_malloc (msg->host->len + 1);
+ rspamd_strlcpy (to_resolve, msg->host->str, msg->host->len + 1);
+
if (!make_dns_request (resolver, session, NULL, lua_http_dns_handler, cbd,
RDNS_REQUEST_A, msg->host->str)) {
lua_http_maybe_free (cbd);
lua_pushboolean (L, FALSE);
+ g_free (to_resolve);
return 1;
}
+
+ g_free (to_resolve);
}
else {
+ to_resolve = rspamd_mempool_fstrdup (task->task_pool, msg->host);
+
if (!make_dns_request_task (task, lua_http_dns_handler, cbd,
- RDNS_REQUEST_A, msg->host->str)) {
+ RDNS_REQUEST_A, to_resolve)) {
lua_http_maybe_free (cbd);
lua_pushboolean (L, FALSE);