From: Aki Tuomi Date: Mon, 24 Sep 2018 12:29:12 +0000 (+0300) Subject: push-notification-driver-lua: Reference mail user only if initialization is successful X-Git-Tag: 2.3.4~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d686d75ce7835117fe7ccb944e5ea885f42b9535;p=thirdparty%2Fdovecot%2Fcore.git push-notification-driver-lua: Reference mail user only if initialization is successful Will cause assert-crash otherwise if initialization fails --- 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; }