[libsoup/wip/tpopela/negotiate] soup-auth-negotiate: GError can be leaked if set in _update_connection()
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/tpopela/negotiate] soup-auth-negotiate: GError can be leaked if set in _update_connection()
- Date: Tue, 23 Feb 2016 16:27:59 +0000 (UTC)
commit 9d9f2b627c82b95fdbbca50be7aeee286649fefe
Author: Tomas Popela <tpopela redhat com>
Date: Tue Feb 23 17:10:11 2016 +0100
soup-auth-negotiate: GError can be leaked if set in _update_connection()
libsoup/soup-auth-negotiate.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/libsoup/soup-auth-negotiate.c b/libsoup/soup-auth-negotiate.c
index c80d326..20d1a96 100644
--- a/libsoup/soup-auth-negotiate.c
+++ b/libsoup/soup-auth-negotiate.c
@@ -136,14 +136,15 @@ static gboolean
soup_auth_negotiate_update_connection (SoupConnectionAuth *auth, SoupMessage *msg,
const char *header, gpointer state)
{
- SoupNegotiateConnectionState *conn = state;
#ifdef LIBSOUP_HAVE_GSSAPI
+ gboolean success = TRUE;
+ SoupNegotiateConnectionState *conn = state;
SoupAuthNegotiatePrivate *priv = SOUP_AUTH_NEGOTIATE_GET_PRIVATE (auth);
GError *err = NULL;
if (!check_auth_trusted_uri (auth, msg)) {
conn->state = SOUP_NEGOTIATE_FAILED;
- return TRUE;
+ goto out;
}
/* Found negotiate header with no token, start negotiate */
@@ -175,7 +176,7 @@ soup_auth_negotiate_update_connection (SoupConnectionAuth *auth, SoupMessage *ms
auth);
priv->message_got_headers_signal_id = id;
}
- return TRUE;
+ goto out;
} else {
/* FIXME: report further upward via
* soup_message_get_error_message */
@@ -184,14 +185,17 @@ soup_auth_negotiate_update_connection (SoupConnectionAuth *auth, SoupMessage *ms
} else if (!strncmp (header, "Negotiate ", 10)) {
if (soup_gss_client_step (conn, header + 10, &err) == AUTH_GSS_CONTINUE) {
conn->state = SOUP_NEGOTIATE_RECEIVED_CHALLENGE;
- return TRUE;
+ goto out;
}
}
+ conn->state = SOUP_NEGOTIATE_FAILED;
+ out:
g_clear_error (&err);
+ return success;
+#else
+ return FALSE;
#endif /* LIBSOUP_HAVE_GSSAPI */
- conn->state = SOUP_NEGOTIATE_FAILED;
- return TRUE;
}
static GSList *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]