summaryrefslogtreecommitdiff
path: root/desktop/hotlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/hotlist.c')
-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;