[libsoup] soup-auth-digest: fix a leak on re-auth



commit 00170d90c72d0cd2e6fea434e88c03f8e09f7631
Author: Dan Winship <danw gnome org>
Date:   Sat Jan 12 09:42:50 2013 -0500

    soup-auth-digest: fix a leak on re-auth
    
    Calling soup_auth_authenticate() on an already-authenticated
    SoupAuthDigest would leak the old username and hashed password.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690142

 libsoup/soup-auth-digest.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/libsoup/soup-auth-digest.c b/libsoup/soup-auth-digest.c
index b95a996..1fbb639 100644
--- a/libsoup/soup-auth-digest.c
+++ b/libsoup/soup-auth-digest.c
@@ -293,6 +293,9 @@ soup_auth_digest_authenticate (SoupAuth *auth, const char *username,
 	SoupAuthDigestPrivate *priv = SOUP_AUTH_DIGEST_GET_PRIVATE (auth);
 	char *bgen;
 
+	g_clear_pointer (&priv->cnonce, g_free);
+	g_clear_pointer (&priv->user, g_free);
+
 	/* Create client nonce */
 	bgen = g_strdup_printf ("%p:%lu:%lu",
 				auth,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]