]> git.baikalelectronics.ru Git - kernel.git/commit
apparmor: fix memory leak on buffer on error exit path
authorColin Ian King <colin.king@canonical.com>
Tue, 27 Mar 2018 13:35:58 +0000 (14:35 +0100)
committerJohn Johansen <john.johansen@canonical.com>
Sat, 31 Mar 2018 04:14:04 +0000 (21:14 -0700)
commita8fe3ba3d20d89a305d4819a9960b0f828494cc8
treece7b8c97b9af43136d47cadf3ee9350436c9b8e3
parenta94a86e91b48ffc5a4bd01f896caec67f10ea3fa
apparmor: fix memory leak on buffer on error exit path

Currently on the error exit path the allocated buffer is not free'd
causing a memory leak. Fix this by kfree'ing it.

Detected by CoverityScan, CID#1466876 ("Resource leaks")

Fixes: a94a86e91b48 ("apparmor: fix dangling symlinks to policy rawdata after replacement")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/apparmorfs.c