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.9~1372 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c72577eb981f90094175817d4d1e7d6294d421e;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; }