From 3e3196133c160de42d928819d64a5f8ef9a6187b Mon Sep 17 00:00:00 2001 From: uvman Date: Mon, 30 Oct 2006 13:43:09 +0000 Subject: [PATCH] Avoid a memory leak on the error code path. --- libntfs/dir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libntfs/dir.c b/libntfs/dir.c index f54f79cb..e5a20e91 100644 --- a/libntfs/dir.c +++ b/libntfs/dir.c @@ -1376,10 +1376,12 @@ err_out: ntfs_log_perror("Failed to open SD (0x50) attribute of " " inode 0x%llx. Run chkdsk.\n", (unsigned long long)ni->mft_no); - else if (ntfs_attr_rm(na)) + else if (ntfs_attr_rm(na)) { ntfs_log_perror("Failed to remove SD (0x50) attribute " "of inode 0x%llx. Run chkdsk.\n", (unsigned long long)ni->mft_no); + ntfs_attr_close(na); + } } if (rollback_data) { ntfs_attr *na;