[dovecot-cvs] dovecot/src/imap-login client.c, 1.55, 1.56 imap-proxy.c, 1.8, 1.9

tss at dovecot.org tss at dovecot.org
Sat Oct 14 00:11:11 UTC 2006


Update of /var/lib/cvs/dovecot/src/imap-login
In directory talvi:/tmp/cvs-serv6724/imap-login

Modified Files:
	client.c imap-proxy.c 
Log Message:
Reference counter fixing for client while it's being used in login proxy.
Fixes crashes.



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/client.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- client.c	13 Oct 2006 20:06:44 -0000	1.55
+++ client.c	13 Oct 2006 23:11:09 -0000	1.56
@@ -497,6 +497,9 @@
 	if (client->proxy != NULL) {
 		login_proxy_free(client->proxy);
 		client->proxy = NULL;
+
+		i_assert(client->refcount > 1);
+		client_unref(client);
 	}
 
 	if (client->common.proxy != NULL) {

Index: imap-proxy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/imap-proxy.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- imap-proxy.c	10 Aug 2006 21:15:02 -0000	1.8
+++ imap-proxy.c	13 Oct 2006 23:11:09 -0000	1.9
@@ -73,6 +73,7 @@
 
 		i_free(client->proxy_user);
 		client->proxy_user = NULL;
+		client_unref(client);
 		return -1;
 	} else {
 		/* probably some untagged reply */
@@ -132,6 +133,7 @@
 	i_assert(client->refcount > 1);
 	connection_queue_add(1);
 
+	client_ref(client);
 	client->proxy = login_proxy_new(&client->common, host, port,
 					proxy_input, client);
 	if (client->proxy == NULL)



More information about the dovecot-cvs mailing list