[dovecot-cvs] dovecot/src/imap-login client.c, 1.51.2.4, 1.51.2.5 imap-proxy.c, 1.7.2.1, 1.7.2.2

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


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

Modified Files:
      Tag: branch_1_0
	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.51.2.4
retrieving revision 1.51.2.5
diff -u -d -r1.51.2.4 -r1.51.2.5
--- client.c	13 Oct 2006 20:06:42 -0000	1.51.2.4
+++ client.c	13 Oct 2006 23:11:03 -0000	1.51.2.5
@@ -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.7.2.1
retrieving revision 1.7.2.2
diff -u -d -r1.7.2.1 -r1.7.2.2
--- imap-proxy.c	10 Aug 2006 21:14:53 -0000	1.7.2.1
+++ imap-proxy.c	13 Oct 2006 23:11:03 -0000	1.7.2.2
@@ -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