summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcos Chavarría Teijeiro <chavarria1991@gmail.com>2014-09-09 10:51:36 +0200
committerShaun McCance <shaunm@gnome.org>2014-09-11 11:21:55 -0400
commita6d3b1c2a109514cd0e16c3a98c9952e641a4fa4 (patch)
treec178242198176cc3642f6bc22076d5934cff8b88
parentbb7b383ce374f5f9964e64f96226284951da299d (diff)
downloadyelp-a6d3b1c2a109514cd0e16c3a98c9952e641a4fa4.tar.gz
Fix crash on searching.
I have moved page_id lookup to the line before the if block where we construct the search page result. So when we lookup for the document content using the page_id, it's available and the program doesn't throw a segmentation fault. https://bugzilla.gnome.org/show_bug.cgi?id=736312
-rw-r--r--libyelp/yelp-document.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index 68041ac8..d62e4985 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -917,6 +917,8 @@ document_read_contents (YelpDocument *document,
g_mutex_lock (&document->priv->mutex);
+ real = hash_lookup (document->priv->page_ids, page_id);
+
if (page_id != NULL && g_str_has_prefix (page_id, "search=")) {
gchar *tmp, *tmp2, *txt;
GVariant *value;
@@ -1038,7 +1040,6 @@ document_read_contents (YelpDocument *document,
return (const gchar *) str;
}
- real = hash_lookup (document->priv->page_ids, page_id);
str = hash_lookup (document->priv->contents, real);
if (str)
str_ref (str);