Better cleanup in close_connection()

This commit is contained in:
Sergey Lyubka committed 2013-05-15 08:28:56 +01:00
1 parent 215ea28db0
commit 7d5bcec92d
1 file changed
+2
+2
View File
@@ -4888,11 +4888,13 @@ static void close_connection(struct mg_connection *conn) {
conn->must_close = 1; conn->must_close = 1;
if (conn->client.sock != INVALID_SOCKET) { if (conn->client.sock != INVALID_SOCKET) {
close_socket_gracefully(conn); close_socket_gracefully(conn);
conn->client.sock = INVALID_SOCKET;
} }
#ifndef NO_SSL #ifndef NO_SSL
// Must be done AFTER socket is closed // Must be done AFTER socket is closed
if (conn->ssl != NULL) { if (conn->ssl != NULL) {
SSL_free(conn->ssl); SSL_free(conn->ssl);
conn->ssl = NULL;
} }
#endif #endif
} }