dovecot-2.2: auth: Keep auth_request referenced during DNS lookup.

dovecot at dovecot.org dovecot at dovecot.org
Tue May 28 17:30:59 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/5a223c6d833f
changeset: 16408:5a223c6d833f
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 28 17:30:42 2013 +0300
description:
auth: Keep auth_request referenced during DNS lookup.
If the underlying auth connection gets closed, there's nothing else
referencing the auth_request.

diffstat:

 src/auth/auth-request.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r feee5a1527d9 -r 5a223c6d833f src/auth/auth-request.c
--- a/src/auth/auth-request.c	Tue May 28 17:10:03 2013 +0300
+++ b/src/auth/auth-request.c	Tue May 28 17:30:42 2013 +0300
@@ -1656,6 +1656,7 @@
 	}
 	if (ctx->callback != NULL)
 		ctx->callback(result->ret == 0, request);
+	auth_request_unref(&request);
 }
 
 static int auth_request_proxy_host_lookup(struct auth_request *request,
@@ -1683,12 +1684,14 @@
 
 	ctx = p_new(request->pool, struct auth_request_proxy_dns_lookup_ctx, 1);
 	ctx->request = request;
+	auth_request_ref(request);
 
 	if (dns_lookup(host, &dns_set, auth_request_proxy_dns_callback, ctx,
 		       &ctx->dns_lookup) < 0) {
 		/* failed early */
 		request->internal_failure = TRUE;
 		auth_request_proxy_finish_failure(request);
+		auth_request_unref(&request);
 		return -1;
 	}
 	ctx->callback = callback;


More information about the dovecot-cvs mailing list