[libsoup/gnome-3-0] Fix few memory leaks



commit e411c8e7d3b9e6a2c68c3fa9d12539afa887bb8e
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 3 07:59:01 2011 +0200

    Fix few memory leaks
    
    https://bugzilla.gnome.org/show_bug.cgi?id=651643

 libsoup/soup-headers.c      |    2 ++
 libsoup/soup-session-sync.c |    2 ++
 tests/dns.c                 |    2 ++
 3 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libsoup/soup-headers.c b/libsoup/soup-headers.c
index 2b9c29d..1118e88 100644
--- a/libsoup/soup-headers.c
+++ b/libsoup/soup-headers.c
@@ -755,6 +755,8 @@ parse_param_list (const char *header, char delim)
 
 		if (override || !g_hash_table_lookup (params, item))
 			g_hash_table_replace (params, item, value);
+		else
+			g_free (item);
 	}
 
 	g_slist_free (list);
diff --git a/libsoup/soup-session-sync.c b/libsoup/soup-session-sync.c
index 8cc7ab5..3719dc2 100644
--- a/libsoup/soup-session-sync.c
+++ b/libsoup/soup-session-sync.c
@@ -444,4 +444,6 @@ flush_queue (SoupSession *session)
 			g_cond_wait (priv->cond, priv->lock);
 	} while (!done);
 	g_mutex_unlock (priv->lock);
+
+	g_hash_table_destroy (current);
 }
diff --git a/tests/dns.c b/tests/dns.c
index d0101ee..6c44800 100644
--- a/tests/dns.c
+++ b/tests/dns.c
@@ -20,6 +20,8 @@ resolve_callback (SoupAddress *addr, guint status, gpointer data)
 	}
 	printf ("\n");
 
+	g_object_unref (addr);
+
 	nlookups--;
 	if (nlookups == 0)
 		g_main_loop_quit (loop);



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