Patch: tny_camel_mime_part_get_header_pairs leaks all the created header pairs



	Hi,

	This very small and very trivial fix for a leak in
tny_camel_mime_part_get_header_pairs_default. We're leaking all the
pairs created there.

Changelog:
* libtinymail-camel/tny-camel-mime-part.c
(..._get_header_pairs_default): we were leaking all the TnyPair objects
created here. Fixed.

-- 
José Dapena Paz <jdapena igalia com>
Igalia
Index: libtinymail-camel/tny-camel-mime-part.c
===================================================================
--- libtinymail-camel/tny-camel-mime-part.c	(revision 3705)
+++ libtinymail-camel/tny-camel-mime-part.c	(working copy)
@@ -147,7 +147,9 @@
 	for (i=0; i < headers->len; i++)
 	{
 		CamelMediumHeader *header = &g_array_index (headers, CamelMediumHeader, i);
-		tny_list_append (list, G_OBJECT (tny_pair_new (header->name, header->value)));
+		TnyPair *pair = tny_pair_new (header->name, header->value);
+		tny_list_append (list, G_OBJECT (pair));
+		g_object_unref (pair);
 	}
 
 	camel_medium_free_headers (CAMEL_MEDIUM (priv->part), headers);


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