[PATCH] btrfs: fix memory leak on error path in btrfs_get_acl()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If posix_acl_from_xattr() fails we leak memory stored in 'value'.

Signed-off-by: Mariusz Kozlowski <mk@xxxxxxxxxxxx>
---
 fs/btrfs/acl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 2222d16..11c9561 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -61,6 +61,7 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
 		if (size > 0) {
 			acl = posix_acl_from_xattr(value, size);
 			if (IS_ERR(acl))
+				kfree(value);
 				return acl;
 			set_cached_acl(inode, type, acl);
 		}
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux