[dovecot-cvs] dovecot/src/pop3-login client.c,1.7,1.8 client.h,1.2,1.3
cras at procontrol.fi
cras at procontrol.fi
Tue Feb 11 18:56:38 EET 2003
Update of /home/cvs/dovecot/src/pop3-login
In directory danu:/tmp/cvs-serv2094/pop3-login
Modified Files:
client.c client.h
Log Message:
Make sure calling client_destroy() multiple times doesn't break anything.
Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/pop3-login/client.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- client.c 8 Feb 2003 14:09:27 -0000 1.7
+++ client.c 11 Feb 2003 16:56:35 -0000 1.8
@@ -261,6 +261,10 @@
void client_destroy(struct pop3_client *client, const char *reason)
{
+ if (client->destroyed)
+ return;
+ client->destroyed = TRUE;
+
if (reason != NULL)
client_syslog(client, reason);
@@ -277,7 +281,6 @@
net_disconnect(client->common.fd);
client->common.fd = -1;
- i_free(client->common.virtual_user);
client_unref(client);
}
@@ -295,6 +298,7 @@
o_stream_unref(client->output);
buffer_free(client->plain_login);
+ i_free(client->common.virtual_user);
i_free(client);
main_unref();
Index: client.h
===================================================================
RCS file: /home/cvs/dovecot/src/pop3-login/client.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- client.h 2 Feb 2003 10:46:20 -0000 1.2
+++ client.h 11 Feb 2003 16:56:35 -0000 1.3
@@ -20,6 +20,7 @@
buffer_t *plain_login;
unsigned int tls:1;
+ unsigned int destroyed:1;
};
struct client *client_create(int fd, struct ip_addr *ip, int ssl);
More information about the dovecot-cvs
mailing list