summaryrefslogtreecommitdiff
path: root/desktop/hotlist.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-09-08 19:28:57 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-09-08 19:28:57 +0100
commit7f31b2c776b5af3051a5761ead7472df6ee861da (patch)
treef4ffa0700bf16685e5c8616a1a57537a474f1c17 /desktop/hotlist.c
parentf13a11e31fa6a4c3fd5966a61dbc82cf94a486b3 (diff)
downloadnetsurf-7f31b2c776b5af3051a5761ead7472df6ee861da.tar.gz
Fix use after unref.
Diffstat (limited to 'desktop/hotlist.c')
-rw-r--r--desktop/hotlist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index 9af1d9732..fde4c33cf 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -542,7 +542,6 @@ static nserror hotlist_load_entry(dom_node *li, hotlist_load_ctx *ctx)
if (title1 != NULL) {
title = dom_string_data(title1);
- dom_string_unref(title1);
} else {
title = "<No title>";
}
@@ -556,6 +555,9 @@ static nserror hotlist_load_entry(dom_node *li, hotlist_load_ctx *ctx)
warn_user(messages_get_errorcode(err), NULL);
+ if (title1 != NULL)
+ dom_string_unref(title1);
+
return err;
}
@@ -563,6 +565,8 @@ static nserror hotlist_load_entry(dom_node *li, hotlist_load_ctx *ctx)
err = hotlist_add_entry_internal(url, title, NULL, ctx->rel,
ctx->relshp, &ctx->rel);
nsurl_unref(url);
+ if (title1 != NULL)
+ dom_string_unref(title1);
ctx->relshp = TREE_REL_NEXT_SIBLING;
if (err != NSERROR_OK) {