[vlc-devel] commit: Xtag: don't return anything from xtag_free ( Rémi Duraffort )

git version control git at videolan.org
Sun Nov 30 16:08:43 CET 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Nov 30 15:13:35 2008 +0100| [f52d10e513584789ba7a5b3a31aebd75c461dedf] | committer: Rémi Duraffort 

Xtag: don't return anything from xtag_free

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f52d10e513584789ba7a5b3a31aebd75c461dedf
---

 modules/codec/cmml/xtag.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/modules/codec/cmml/xtag.c b/modules/codec/cmml/xtag.c
index 44fe169..3cfd13b 100644
--- a/modules/codec/cmml/xtag.c
+++ b/modules/codec/cmml/xtag.c
@@ -79,7 +79,7 @@ struct _XTagParser {
   char * end;
 };
 
-XTag * xtag_free (XTag * xtag);
+void   xtag_free (XTag * xtag);
 XTag * xtag_new_parse (const char * s, int n);
 char * xtag_get_name (XTag * xtag);
 char * xtag_get_pcdata (XTag * xtag);
@@ -410,20 +410,20 @@ xtag_parse_tag (XTagParser * parser)
   return tag;
 }
 
-XTag *
-xtag_free (XTag * xtag)
+void xtag_free (XTag * xtag)
 {
   XList * l;
   XAttribute * attr;
   XTag * child;
 
-  if (xtag == NULL) return NULL;
+  if( !xtag )
+    return;
 
   free( xtag->name );
   free( xtag->pcdata );
 
-  for (l = xtag->attributes; l; l = l->next) {
-    if ((attr = (XAttribute *)l->data) != NULL) {
+  for( l = xtag->attributes; l; l = l->next) {
+    if((attr = (XAttribute *)l->data) != NULL) {
       free( attr->name );
       free( attr->value );
       free( attr );
@@ -433,13 +433,11 @@ xtag_free (XTag * xtag)
 
   for (l = xtag->children; l; l = l->next) {
     child = (XTag *)l->data;
-    xtag_free (child);
+    xtag_free( child );
   }
   xlist_free (xtag->children);
 
-  free (xtag);
-
-  return NULL;
+  free( xtag );
 }
 
 XTag *




More information about the vlc-devel mailing list