mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
apparmor: fix leak of null profile name if profile allocation fails
[ Upstream commit4633307e5e
] Fixes:d07881d2ed
("apparmor: move new_null_profile to after profile lookup fns()") Reported-by: Seth Arnold <seth.arnold@canonical.com> Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
86d1d015fe
commit
897088926c
1 changed files with 2 additions and 1 deletions
|
@ -502,7 +502,7 @@ struct aa_profile *aa_new_null_profile(struct aa_profile *parent, bool hat,
|
|||
{
|
||||
struct aa_profile *p, *profile;
|
||||
const char *bname;
|
||||
char *name;
|
||||
char *name = NULL;
|
||||
|
||||
AA_BUG(!parent);
|
||||
|
||||
|
@ -562,6 +562,7 @@ struct aa_profile *aa_new_null_profile(struct aa_profile *parent, bool hat,
|
|||
return profile;
|
||||
|
||||
fail:
|
||||
kfree(name);
|
||||
aa_free_profile(profile);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue