summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-09-05 13:06:53 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-09-05 13:06:53 +0100
commit2468d006757ed81b782cfc8291029b2bb9f7411b (patch)
tree62e5a4b86ba4febee5ff9a3abeaa80803717000a
parent411e367add02101011b61c7cb66c9955d48d21e2 (diff)
downloadnetsurf-2468d006757ed81b782cfc8291029b2bb9f7411b.tar.gz
netsurf-2468d006757ed81b782cfc8291029b2bb9f7411b.tar.bz2
Check for error as soon as we have return value.
-rw-r--r--desktop/hotlist.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index 54ff6f86e..9af1d9732 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -653,6 +653,10 @@ nserror hotlist_load_directory_cb(dom_node *node, void *ctx)
/* Add folder node */
err = hotlist_add_folder_internal(title, current_ctx->rel,
current_ctx->relshp, &f);
+ if (err != NSERROR_OK) {
+ dom_string_unref(name);
+ return NSERROR_NOMEM;
+ }
/* Check if folder should be default folder */
error = dom_element_get_attribute(node, corestring_dom_id, &id);
@@ -671,11 +675,6 @@ nserror hotlist_load_directory_cb(dom_node *node, void *ctx)
current_ctx->rel = rel;
current_ctx->relshp = TREE_REL_NEXT_SIBLING;
- if (err != NSERROR_OK) {
- dom_string_unref(name);
- return NSERROR_NOMEM;
- }
-
new_ctx.tree = current_ctx->tree;
new_ctx.rel = rel;
new_ctx.relshp = TREE_REL_FIRST_CHILD;