“dac32632750f284231d835ef78e5b852f1f3b93d”上不存在“doc/_sources/howto/optimization/cpu_profiling.md.txt”
提交 246c3fb1 编写于 作者: W wzt.wzt@gmail.com 提交者: James Morris

APPARMOR: Fix memory leak of alloc_namespace()

policy->name is a substring of policy->hname, if prefix is not NULL, it will
allocted strlen(prefix) + strlen(name) + 3 bytes to policy->hname in policy_init().
use kzfree(ns->base.name) will casue memory leak if alloc_namespace() failed.
Signed-off-by: NZhitong Wang <zhitong.wangzt@alibaba-inc.com>
Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
Signed-off-by: NJames Morris <jmorris@namei.org>
上级 f6614b7b
...@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册