diff --git a/userspace/engine/formats.cpp b/userspace/engine/formats.cpp index 625f9cbf..7be6eaab 100644 --- a/userspace/engine/formats.cpp +++ b/userspace/engine/formats.cpp @@ -49,14 +49,13 @@ int falco_formats::formatter(lua_State *ls) try { formatter = new sinsp_evt_formatter(s_inspector, format); + lua_pushlightuserdata(ls, formatter); } catch(sinsp_exception& e) { luaL_error(ls, "Invalid output format '%s': '%s'", format.c_str(), e.what()); } - lua_pushlightuserdata(ls, formatter); - return 1; }