summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2018-07-23 11:04:35 +0200
committerDavid King <amigadave@amigadave.com>2019-01-21 14:38:59 +0000
commit9252d10b415c62147f20bdedff82318dd303c73e (patch)
treeb45742b7922f99e29c64ffbd9b58a155841e0fbe
parentf97cc50b112326af2eb1ee7e3c43fab5ae057ab6 (diff)
downloadyelp-9252d10b415c62147f20bdedff82318dd303c73e.tar.gz
Check whether the index variable is valid before dereferencing it
yelp-3.28.1/libyelp/yelp-mallard-document.c:1002: deref_ptr: Directly dereferencing pointer "index". yelp-3.28.1/libyelp/yelp-mallard-document.c:1073: check_after_deref: Null-checking "index" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
-rw-r--r--libyelp/yelp-mallard-document.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libyelp/yelp-mallard-document.c b/libyelp/yelp-mallard-document.c
index b72dc9a5..1302a116 100644
--- a/libyelp/yelp-mallard-document.c
+++ b/libyelp/yelp-mallard-document.c
@@ -1099,8 +1099,7 @@ mallard_index_threaded (YelpMallardDocument *mallard)
xmlXPathFreeContext (xpath);
if (index->doc != NULL)
xmlFreeDoc (index->doc);
- if (index != NULL)
- g_free (index);
+ g_free (index);
if (parserCtxt != NULL)
xmlFreeParserCtxt (parserCtxt);
g_object_unref (pagefile);