Re: [evolution-patches] [PATCH] leak fix(es) in e-xml-hash-utils



On Thu, 2004-01-22 at 12:21, Rodrigo Moya wrote:
> I didn't mean this message, which should clearly be 'Key not found' or
> something similar...
[...]
> also, the patch is missing a ChangeLog entry.

Hi,

I changed both messages, and added a ChangeLog entry. Hope I have got
everything right this time :-)

regards,
Thomas.


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/ChangeLog,v
retrieving revision 1.88
diff -u -r1.88 ChangeLog
--- ChangeLog	21 Jan 2004 23:37:19 -0000	1.88
+++ ChangeLog	22 Jan 2004 22:06:50 -0000
@@ -1,3 +1,8 @@
+2004-01-22  Thomas Cataldo  <tcataldo users sourceforge net>
+
+	* libedataserver/e-xml-hash-utils.c: (e_xml_to_hash):
+	Fix leak.
+
 2004-01-21  Rodrigo Moya <rodrigo ximian com>
 
 	* libedataserver/e-file-cache.[ch] (e_file_cache_remove): new function
Index: libedataserver/e-xml-hash-utils.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserver/e-xml-hash-utils.c,v
retrieving revision 1.2
diff -u -r1.2 e-xml-hash-utils.c
--- libedataserver/e-xml-hash-utils.c	21 Jan 2004 10:18:04 -0000	1.2
+++ libedataserver/e-xml-hash-utils.c	22 Jan 2004 22:07:21 -0000
@@ -49,13 +49,20 @@
 		else
 			key = node->name;
 
+		if (!key) {
+			g_warning ("Key not found!!");
+			continue;
+		}
+
 		value = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
-		if (!key || !value) {
-			g_warning ("Found an entry with missing properties!!");
+		if (!value) {
+			xmlFree (key);
+			g_warning ("Found a key with no value!!");
 			continue;
 		}
 
 		g_hash_table_insert (hash, g_strdup (key), g_strdup (value));
+		xmlFree (key);
 		xmlFree (value);
 	}
 


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