]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Don't leak memory if HTTP client disconnects unexpectedly.
authorTimo Sirainen <tss@iki.fi>
Mon, 11 Aug 2014 12:45:21 +0000 (15:45 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 11 Aug 2014 12:45:21 +0000 (15:45 +0300)
http_server_connection_disconnect() has several cleanup calls, which weren't
done because closed=TRUE was set explicitly and that skipped the cleanup.

src/lib-http/http-server-connection.c

index 9931134712ab11616c230597dfdbe039a922d4c4..eeb4be1d63e2a5d1ea7b840ee688d4dea87e933e 100644 (file)
 
 #include "http-server-private.h"
 
+static void
+http_server_connection_disconnect(struct http_server_connection *conn,
+       const char *reason);
+
 /*
  * Logging
  */
@@ -163,7 +167,7 @@ static void http_server_connection_destroy(struct connection *_conn)
        struct http_server_connection *conn =
                (struct http_server_connection *)_conn;
 
-       conn->closed = TRUE;
+       http_server_connection_disconnect(conn, NULL);
        http_server_connection_unref(&conn);
 }