Skip to content

Commit

Permalink
xml: xml_document_free() return if NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
wipawel committed Jul 22, 2014
1 parent 8f523e6 commit 2abbb02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xml.c
Expand Up @@ -73,6 +73,9 @@ xml_document_take_root(xml_document_t *doc)
void
xml_document_free(xml_document_t *doc)
{
if (xml_document_is_empty(doc))
return;

xml_node_free(doc->root);
ni_string_free(&doc->dtd);
free(doc);
Expand Down

0 comments on commit 2abbb02

Please sign in to comment.