From d686d75ce7835117fe7ccb944e5ea885f42b9535 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 24 Sep 2018 15:29:12 +0300 Subject: [PATCH] push-notification-driver-lua: Reference mail user only if initialization is successful Will cause assert-crash otherwise if initialization fails --- src/plugins/push-notification/push-notification-driver-lua.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/push-notification/push-notification-driver-lua.c b/src/plugins/push-notification/push-notification-driver-lua.c index 6afca9c143..418b21d097 100644 --- a/src/plugins/push-notification/push-notification-driver-lua.c +++ b/src/plugins/push-notification/push-notification-driver-lua.c @@ -119,8 +119,6 @@ static bool push_notification_driver_lua_begin_txn int luaerr; - mail_user_ref(user); - config1 = p_new(dtxn->ptxn->pool, struct push_notification_event_messagenew_config, 1); config1->flags = DLUA_DEFAULT_EVENTS; @@ -160,6 +158,7 @@ static bool push_notification_driver_lua_begin_txn tctx->tx_ref = luaL_ref(ctx->script->L, LUA_REGISTRYINDEX); dtxn->context = tctx; + mail_user_ref(user); return TRUE; } -- 2.47.3