[dovecot-cvs] dovecot/src/imap-login imap-proxy.c,1.7.2.2,1.7.2.3

tss at dovecot.org tss at dovecot.org
Tue Nov 7 14:01:19 UTC 2006


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

Modified Files:
      Tag: branch_1_0
	imap-proxy.c 
Log Message:
If client disconnects before logging into remote server is complete, don't
crash/leak memory.



Index: imap-proxy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/imap-proxy.c,v
retrieving revision 1.7.2.2
retrieving revision 1.7.2.3
diff -u -d -r1.7.2.2 -r1.7.2.3
--- imap-proxy.c	13 Oct 2006 23:11:03 -0000	1.7.2.2
+++ imap-proxy.c	7 Nov 2006 14:01:14 -0000	1.7.2.3
@@ -15,6 +15,15 @@
 {
 	string_t *str;
 
+	if (client->destroyed) {
+		/* client already disconnected. */
+		login_proxy_free(client->proxy);
+		client->proxy = NULL;
+
+		client_unref(client);
+		return -1;
+	}
+
 	if (!client->proxy_login_sent) {
 		/* this is a banner */
 		if (strncmp(line, "* OK ", 5) != 0) {



More information about the dovecot-cvs mailing list