]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lua: dlua-dovecot - Ensure script is not NULL
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 5 Feb 2021 11:41:24 +0000 (13:41 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 22 Mar 2021 10:38:20 +0000 (10:38 +0000)
src/lib-lua/dlua-dovecot.c

index f115c91c20fc47fdc539610ca114f719f32cacdc..8531e6eab72ef3eb3980741c174d1bb8b277bfbc 100644 (file)
@@ -492,6 +492,8 @@ static const luaL_Reg event_methods[] ={
 };
 
 static void dlua_event_register(struct dlua_script *script){
+       i_assert(script != NULL);
+
        luaL_newmetatable(script->L, DLUA_EVENT_PASSTHROUGH);
        lua_pushvalue(script->L, -1);
        lua_setfield(script->L, -2, "__index");
@@ -588,6 +590,8 @@ void dlua_getdovecot(lua_State *L)
 
 void dlua_dovecot_register(struct dlua_script *script)
 {
+       i_assert(script != NULL);
+
        dlua_event_register(script);
 
        /* Create table for holding values */