summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libyelp/yelp-docbook-document.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libyelp/yelp-docbook-document.c b/libyelp/yelp-docbook-document.c
index 9557427f..62f40611 100644
--- a/libyelp/yelp-docbook-document.c
+++ b/libyelp/yelp-docbook-document.c
@@ -1129,12 +1129,13 @@ docbook_index_threaded (YelpDocbookDocument *docbook)
g_object_unref (file);
if (filename != NULL)
g_free (filename);
- if (index->doc != NULL)
- xmlFreeDoc (index->doc);
- if (index->doc_uri != NULL)
- g_free (index->doc_uri);
- if (index != NULL)
+ if (index != NULL) {
+ if (index->doc != NULL)
+ xmlFreeDoc (index->doc);
+ if (index->doc_uri != NULL)
+ g_free (index->doc_uri);
g_free (index);
+ }
if (parserCtxt != NULL)
xmlFreeParserCtxt (parserCtxt);