]> wimlib.net Git - wimlib/blobdiff - src/modify.c
Remove link_dentry()
[wimlib] / src / modify.c
index 76049d8df437ddf8769b2eb5153042d14dc4b24a..7fc1a6cfe4f21eca877a581b0b5601a9a4aa3d85 100644 (file)
@@ -196,7 +196,7 @@ static int build_dentry_tree(struct dentry **root_ret,
                        if (ret != 0)
                                break;
                        if (child)
-                               link_dentry(child, root);
+                               dentry_add_child(root, child);
                }
                closedir(dir);
        } else if (dentry_is_symlink(root)) { /* Archiving a symbolic link */
@@ -389,7 +389,7 @@ static int add_new_dentry_tree(WIMStruct *w, struct dentry *root_dentry,
 
        if (!imd) {
                ERROR("Failed to allocate memory for new image metadata array");
-               return WIMLIB_ERR_NOMEM;
+               goto err;
        }
 
        memcpy(imd, w->image_metadata,
@@ -397,7 +397,7 @@ static int add_new_dentry_tree(WIMStruct *w, struct dentry *root_dentry,
 
        metadata_lte = new_lookup_table_entry();
        if (!metadata_lte)
-               goto out_free_imd;
+               goto err_free_imd;
 
        metadata_lte->resource_entry.flags = WIM_RESHDR_FLAG_METADATA;
        random_hash(metadata_lte->hash);
@@ -420,10 +420,9 @@ static int add_new_dentry_tree(WIMStruct *w, struct dentry *root_dentry,
        ret = select_wim_image(w, w->hdr.image_count);
        wimlib_assert(ret == 0);
        return ret;
-out_free_metadata_lte:
-       FREE(metadata_lte);
-out_free_imd:
+err_free_imd:
        FREE(imd);
+err:
        return WIMLIB_ERR_NOMEM;
 
 }