From e4807fb950ddfdf4196b9765f036265a0b83e7f9 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 29 Jul 2003 15:04:01 +0000 Subject: [PATCH] 1.99.25 ("Potato and Leek Soup") * configure.in: 1.99.25 ("Potato and Leek Soup") * libsoup/soup-message.c (requeue_read_finished, release_connection): Free the passed-in body data. Otherwise the response body ends up getting leaked on most 3xx and 4xx responses. (soup_message_cleanup): Remove a piece of code that didn't actually do anything and its associated confused comment. * libsoup/soup-auth.c (ntlm_free): plug an occasional NTLM auth leak * libsoup/soup-context.c (connection_free): plug a non-occasional NTLM auth leak. --- ChangeLog | 16 ++++++++++++++++ configure.in | 2 +- libsoup/soup-auth.c | 1 + libsoup/soup-context.c | 5 +++++ libsoup/soup-message.c | 11 ++++++----- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6078974..94ab74e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2003-07-29 Dan Winship + + * configure.in: 1.99.25 ("Potato and Leek Soup") + + * libsoup/soup-message.c (requeue_read_finished, + release_connection): Free the passed-in body data. Otherwise the + response body ends up getting leaked on most 3xx and 4xx + responses. + (soup_message_cleanup): Remove a piece of code that didn't + actually do anything and its associated confused comment. + + * libsoup/soup-auth.c (ntlm_free): plug an occasional NTLM auth leak + + * libsoup/soup-context.c (connection_free): plug a non-occasional + NTLM auth leak. + 2003-06-26 Joe Shaw * configure.in: Version 1.99.24 diff --git a/configure.in b/configure.in index 24c886c..3be931c 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl ******************************************* AC_INIT(libsoup/soup.h) -AM_INIT_AUTOMAKE(libsoup, 1.99.24) +AM_INIT_AUTOMAKE(libsoup, 1.99.25) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_PROG_MAKE_SET diff --git a/libsoup/soup-auth.c b/libsoup/soup-auth.c index d149084..c8e3305 100644 --- a/libsoup/soup-auth.c +++ b/libsoup/soup-auth.c @@ -541,6 +541,7 @@ ntlm_free (SoupAuth *sa) SoupAuthNTLM *auth = (SoupAuthNTLM *) sa; g_free (auth->response); + g_free (auth->header); g_free (auth); } diff --git a/libsoup/soup-context.c b/libsoup/soup-context.c index 940d80e..e5dc6e9 100644 --- a/libsoup/soup-context.c +++ b/libsoup/soup-context.c @@ -257,6 +257,11 @@ connection_free (SoupConnection *conn) conn->server->connections = g_slist_remove (conn->server->connections, conn); + if (conn->auth) { + soup_auth_invalidate (conn->auth, conn->context); + soup_auth_free (conn->auth); + } + g_io_channel_unref (conn->channel); soup_context_unref (conn->context); soup_socket_unref (conn->socket); diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c index e4a9d19..92079c1 100644 --- a/libsoup/soup-message.c +++ b/libsoup/soup-message.c @@ -147,6 +147,9 @@ release_connection (const SoupDataBuffer *data, { SoupConnection *conn = user_data; soup_connection_release (conn); + + if (data->owner == SOUP_BUFFER_SYSTEM_OWNED) + g_free (data->body); } static void @@ -183,11 +186,6 @@ soup_message_cleanup (SoupMessage *req) soup_transfer_read_unref (req->priv->read_tag); req->priv->read_tag = NULL; req->connection = NULL; - /* - * The buffer doesn't belong to us until the message is - * finished. - */ - req->response.owner = SOUP_BUFFER_STATIC; } if (req->priv->read_tag) { @@ -544,6 +542,9 @@ requeue_read_finished (const SoupDataBuffer *buf, SoupMessage *msg = user_data; SoupConnection *conn = msg->connection; + if (buf->owner == SOUP_BUFFER_SYSTEM_OWNED) + g_free (buf->body); + soup_connection_set_used (msg->connection); if (!soup_connection_is_keep_alive (msg->connection)) requeue_read_error (FALSE, msg); -- 2.7.4