mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 10:04:00 +08:00
check and handle ntfs_inode_close() return value
This commit is contained in:
parent
7b02774d67
commit
a5ee2e2039
@ -485,7 +485,10 @@ ntfs_inode *ntfs_pathname_to_inode(ntfs_volume *vol, ntfs_inode *parent,
|
||||
}
|
||||
|
||||
if (ni != parent)
|
||||
ntfs_inode_close(ni);
|
||||
if (ntfs_inode_close(ni)) {
|
||||
err = errno;
|
||||
goto out;
|
||||
}
|
||||
|
||||
inum = MREF(inum);
|
||||
ni = ntfs_inode_open(vol, inum);
|
||||
@ -505,7 +508,9 @@ ntfs_inode *ntfs_pathname_to_inode(ntfs_volume *vol, ntfs_inode *parent,
|
||||
ni = NULL;
|
||||
close:
|
||||
if (ni && (ni != parent))
|
||||
ntfs_inode_close(ni);
|
||||
if (ntfs_inode_close(ni) && !err)
|
||||
err = errno;
|
||||
out:
|
||||
free(ascii);
|
||||
free(unicode);
|
||||
if (err)
|
||||
@ -1531,8 +1536,8 @@ out:
|
||||
ntfs_attr_put_search_ctx(actx);
|
||||
if (ictx)
|
||||
ntfs_index_ctx_put(ictx);
|
||||
if (ni)
|
||||
ntfs_inode_close(ni);
|
||||
if (ni && ntfs_inode_close(ni) && !err)
|
||||
err = errno;
|
||||
if (err) {
|
||||
errno = err;
|
||||
ntfs_log_debug("Could not delete file: %s\n", strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user