From 7f31b2c776b5af3051a5761ead7472df6ee861da Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 8 Sep 2013 19:28:57 +0100 Subject: Fix use after unref. --- desktop/hotlist.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 = ""; } @@ -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) { -- cgit v1.2.3