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

Commit 4633307e authored by John Johansen's avatar John Johansen
Browse files

apparmor: fix leak of null profile name if profile allocation fails



Fixes: d07881d2 ("apparmor: move new_null_profile to after profile lookup fns()")
Reported-by: default avatarSeth Arnold <seth.arnold@canonical.com>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent e3bcfc14
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
}