From: Remi Gacogne Date: Tue, 29 Mar 2022 16:09:28 +0000 (+0200) Subject: LuaWrapper: Prevent referencing a temporary object X-Git-Tag: rec-4.7.0-beta1~28^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11482%2Fhead;p=thirdparty%2Fpdns.git LuaWrapper: Prevent referencing a temporary object Reported by Coverity (CIDs 120403 and 145915) --- diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index e3a87ee9b7..9f8d473fb7 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -1770,7 +1770,8 @@ private: -> typename std::enable_if::value, TRetValue>::type { if (index >= 0) { - Binder binder{ callback, {} }; + static const TFirstType empty{}; + Binder binder{ callback, empty }; return readIntoFunction(state, retValueTag, binder, index + 1, othersTags...); }