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

Re: [E-devel] Patch for exml



ok.

it's good.

> On Thursday, 01 June 2006, at 20:51:53 (+0000),
> BRUNEL Maxime wrote:
> 
> > i post a patch for exml (the file exml.c in libs/exml/src) which
> > removes leaks ;)
> 
> Patches need to be submitted in unified format (diff -u).
> 
> Michael
> 
--- /home/maxtoo/exml.c	2006-06-01 19:30:42.000000000 +0000
+++ exml.c	2006-06-01 19:45:36.000000000 +0000
@@ -173,10 +173,10 @@
 	EXML_Node *node = data;
 
 	if( node ) {
+	        ecore_hash_destroy( node->attributes );
 		IF_FREE(node->tag);
 		IF_FREE(node->value);
 		ecore_list_destroy( node->children );
-
 		FREE(node);
 	}
 }
@@ -580,6 +580,8 @@
 						attr_value = xmlTextReaderValue( reader );
 
 						exml_attribute_set(xml, (char *) attr_name, (char *) attr_value);
+						xmlFree(attr_name);
+						xmlFree(attr_value);
 					} while( xmlTextReaderMoveToNextAttribute( reader ) == 1 );
 				}
 
@@ -594,10 +596,12 @@
 				exml_value_set(xml, (char *) value);
 				break;
 		}
+	  xmlFree(name);
+	  xmlFree(value);
 	}
 
 	xmlTextReaderClose( reader );
-
+        xmlFreeTextReader( reader );
 	exml_goto_top( xml );
 
 	return TRUE;