]> wimlib.net Git - wimlib/blobdiff - src/ntfs-capture.c
Version 1.2.1
[wimlib] / src / ntfs-capture.c
index 0abbebac94608ab53bc4a2b5808b419f289030be..8f123f805a9afb4d10d035fbac8aeea98c617521 100644 (file)
@@ -474,7 +474,6 @@ static int wim_ntfs_capture_filldir(void *dirent, const ntfschar *name,
        ntfs_inode_close(ni);
 out_free_utf8_name:
        FREE(utf8_name);
-out:
        return ret;
 }
 
@@ -556,8 +555,10 @@ static int build_dentry_tree_ntfs_recursive(struct dentry **root_p,
        if (!root) {
                if (errno == EILSEQ)
                        return WIMLIB_ERR_INVALID_UTF8_STRING;
-               else
+               else if (errno == ENOMEM)
                        return WIMLIB_ERR_NOMEM;
+               else
+                       return WIMLIB_ERR_ICONV_NOT_AVAILABLE;
        }
        *root_p = root;
 
@@ -720,6 +721,10 @@ out_cleanup:
        destroy_sd_set(&sd_set);
 
 out:
+       ntfs_index_ctx_put(vol->secure_xsii);
+       ntfs_index_ctx_put(vol->secure_xsdh);
+       ntfs_inode_close(vol->secure_ni);
+
        if (ret) {
                if (ntfs_umount(vol, FALSE) != 0) {
                        ERROR_WITH_ERRNO("Failed to unmount NTFS volume `%s'",