[dovecot-cvs] dovecot/src/pop3-login client.c, 1.50.2.4, 1.50.2.5 pop3-proxy.c, 1.10.2.1, 1.10.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/pop3-login
In directory talvi:/tmp/cvs-serv6698/pop3-login

Modified Files:
      Tag: branch_1_0
	client.c pop3-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/pop3-login/client.c,v
retrieving revision 1.50.2.4
retrieving revision 1.50.2.5
diff -u -d -r1.50.2.4 -r1.50.2.5
--- client.c	13 Oct 2006 20:06:43 -0000	1.50.2.4
+++ client.c	13 Oct 2006 23:11:04 -0000	1.50.2.5
@@ -388,6 +388,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: pop3-proxy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/pop3-proxy.c,v
retrieving revision 1.10.2.1
retrieving revision 1.10.2.2
diff -u -d -r1.10.2.1 -r1.10.2.2
--- pop3-proxy.c	10 Aug 2006 21:14:53 -0000	1.10.2.1
+++ pop3-proxy.c	13 Oct 2006 23:11:04 -0000	1.10.2.2
@@ -130,6 +130,8 @@
 
 	i_free(client->proxy_user);
 	client->proxy_user = NULL;
+
+	client_unref(client);
 }
 
 int pop3_proxy_new(struct pop3_client *client, const char *host,
@@ -146,6 +148,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