From ecc1be7bb71a0a6de4c3adcd7b0e6cfcebac6ccf Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Tue, 25 Sep 2018 15:49:21 +0300 Subject: [PATCH] mail-lua: Fix gc code to push key first then value Otherwise it uses nil as key, which makes no sense and leads to eventual crash. --- src/plugins/mail-lua/mail-storage-lua.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/mail-lua/mail-storage-lua.c b/src/plugins/mail-lua/mail-storage-lua.c index 426567d0fb..32e9ec4e75 100644 --- a/src/plugins/mail-lua/mail-storage-lua.c +++ b/src/plugins/mail-lua/mail-storage-lua.c @@ -170,8 +170,8 @@ static int lua_storage_mail_user_unref(lua_State *L) (void)lua_check_storage_mail_user(script, 1); /* reset value to NULL */ - lua_pushnil(script->L); lua_pushliteral(script->L, "item"); + lua_pushnil(script->L); lua_rawset(script->L, 1); return 0; @@ -297,8 +297,8 @@ static int lua_storage_mailbox_gc(lua_State *L) (void)lua_check_storage_mailbox(script, 1); /* reset value to NULL */ - lua_pushnil(script->L); lua_pushliteral(script->L, "item"); + lua_pushnil(script->L); lua_rawset(script->L, 1); return 0; @@ -535,8 +535,8 @@ static int lua_storage_mail_gc(lua_State *L) (void)lua_check_storage_mail(script, 1); /* reset value to NULL */ - lua_pushnil(script->L); lua_pushliteral(script->L, "item"); + lua_pushnil(script->L); lua_rawset(script->L, 1); return 0; -- 2.47.3