]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: sasl-server-request - Allow auth_new and auth_free mechanism functions to be...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sun, 19 Nov 2023 02:55:39 +0000 (03:55 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 9 Oct 2025 08:41:22 +0000 (08:41 +0000)
src/auth/sasl-server-request.c

index b787dab9ed49a56398e08ee5094eaf4f2cce27b8..d2b41124830c1949297ae415a2916a06b1a0314c 100644 (file)
@@ -17,7 +17,10 @@ void sasl_server_request_create(struct auth_request *request,
        pool_t pool;
 
        pool = request->pool;
-       mreq = mech->auth_new(pool);
+       if (mech->auth_new != NULL)
+               mreq = mech->auth_new(pool);
+       else
+               mreq = p_new(pool, struct sasl_server_mech_request, 1);
        mreq->pool = pool;
        mreq->request = request;
        mreq->mech = mech;
@@ -34,7 +37,8 @@ void sasl_server_request_destroy(struct auth_request *request)
                return;
        request->sasl = NULL;
 
-       mreq->mech->auth_free(mreq);
+       if (mreq->mech->auth_free != NULL)
+               mreq->mech->auth_free(mreq);
 }
 
 /*