Commit f52d10e5 authored by Rémi Duraffort's avatar Rémi Duraffort

Xtag: don't return anything from xtag_free

parent c109dcf1
...@@ -79,7 +79,7 @@ struct _XTagParser { ...@@ -79,7 +79,7 @@ struct _XTagParser {
char * end; char * end;
}; };
XTag * xtag_free (XTag * xtag); void xtag_free (XTag * xtag);
XTag * xtag_new_parse (const char * s, int n); XTag * xtag_new_parse (const char * s, int n);
char * xtag_get_name (XTag * xtag); char * xtag_get_name (XTag * xtag);
char * xtag_get_pcdata (XTag * xtag); char * xtag_get_pcdata (XTag * xtag);
...@@ -410,20 +410,20 @@ xtag_parse_tag (XTagParser * parser) ...@@ -410,20 +410,20 @@ xtag_parse_tag (XTagParser * parser)
return tag; return tag;
} }
XTag * void xtag_free (XTag * xtag)
xtag_free (XTag * xtag)
{ {
XList * l; XList * l;
XAttribute * attr; XAttribute * attr;
XTag * child; XTag * child;
if (xtag == NULL) return NULL; if( !xtag )
return;
free( xtag->name ); free( xtag->name );
free( xtag->pcdata ); free( xtag->pcdata );
for (l = xtag->attributes; l; l = l->next) { for( l = xtag->attributes; l; l = l->next) {
if ((attr = (XAttribute *)l->data) != NULL) { if((attr = (XAttribute *)l->data) != NULL) {
free( attr->name ); free( attr->name );
free( attr->value ); free( attr->value );
free( attr ); free( attr );
...@@ -433,13 +433,11 @@ xtag_free (XTag * xtag) ...@@ -433,13 +433,11 @@ xtag_free (XTag * xtag)
for (l = xtag->children; l; l = l->next) { for (l = xtag->children; l; l = l->next) {
child = (XTag *)l->data; child = (XTag *)l->data;
xtag_free (child); xtag_free( child );
} }
xlist_free (xtag->children); xlist_free (xtag->children);
free (xtag); free( xtag );
return NULL;
} }
XTag * XTag *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment