Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42838bb2 authored by Jesper Juhl's avatar Jesper Juhl Committed by Chris Mason
Browse files

btrfs: Mem leak in btrfs_get_acl()



It seems to me that we leak the memory allocated to 'value' in
btrfs_get_acl() if the call to posix_acl_from_xattr() fails.
Here's a patch that attempts to correct that problem.

Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 6d07bcec
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -60,8 +60,10 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
		size = __btrfs_getxattr(inode, name, value, size);
		if (size > 0) {
			acl = posix_acl_from_xattr(value, size);
			if (IS_ERR(acl))
			if (IS_ERR(acl)) {
				kfree(value);
				return acl;
			}
			set_cached_acl(inode, type, acl);
		}
		kfree(value);