From: Charles-Henri Bruyand Date: Tue, 8 May 2018 23:14:42 +0000 (+0200) Subject: rec: ensure lua-dns-script has been properly initialized X-Git-Tag: dnsdist-1.3.1~26^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9adbe79034783bc5f2e20a57d425eb690035e107;p=thirdparty%2Fpdns.git rec: ensure lua-dns-script has been properly initialized --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index a11b45c661..fbd83cdb3c 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -3556,9 +3556,12 @@ try last_carbon = g_now.tv_sec; } } - if(g_now.tv_sec - last_lua_maintenance >= luaMaintenanceInterval) { - t_pdl->maintenance(); - last_lua_maintenance = g_now.tv_sec; + if (t_pdl != nullptr) { + // lua-dns-script directive is present, call the maintenance callback if needed + if(g_now.tv_sec - last_lua_maintenance >= luaMaintenanceInterval) { + t_pdl->maintenance(); + last_lua_maintenance = g_now.tv_sec; + } } t_fdm->run(&g_now);