Commit fe7e96f6 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of...

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  APPARMOR: Fix memory leak of apparmor_init()
  APPARMOR: Fix memory leak of alloc_namespace()
parents 0f90933c a26d279e
...@@ -922,7 +922,7 @@ static int __init apparmor_init(void) ...@@ -922,7 +922,7 @@ static int __init apparmor_init(void)
error = register_security(&apparmor_ops); error = register_security(&apparmor_ops);
if (error) { if (error) {
AA_ERROR("Unable to register AppArmor\n"); AA_ERROR("Unable to register AppArmor\n");
goto register_security_out; goto set_init_cxt_out;
} }
/* Report that AppArmor successfully initialized */ /* Report that AppArmor successfully initialized */
...@@ -936,6 +936,9 @@ static int __init apparmor_init(void) ...@@ -936,6 +936,9 @@ static int __init apparmor_init(void)
return error; return error;
set_init_cxt_out:
aa_free_task_context(current->real_cred->security);
register_security_out: register_security_out:
aa_free_root_ns(); aa_free_root_ns();
...@@ -944,7 +947,6 @@ static int __init apparmor_init(void) ...@@ -944,7 +947,6 @@ static int __init apparmor_init(void)
apparmor_enabled = 0; apparmor_enabled = 0;
return error; return error;
} }
security_initcall(apparmor_init); security_initcall(apparmor_init);
...@@ -306,7 +306,7 @@ static struct aa_namespace *alloc_namespace(const char *prefix, ...@@ -306,7 +306,7 @@ static struct aa_namespace *alloc_namespace(const char *prefix,
return ns; return ns;
fail_unconfined: fail_unconfined:
kzfree(ns->base.name); kzfree(ns->base.hname);
fail_ns: fail_ns:
kzfree(ns); kzfree(ns);
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment