]> git.baikalelectronics.ru Git - kernel.git/commit
SELinux: memory leak in security_context_to_sid_core
authorEric Paris <eparis@redhat.com>
Wed, 3 Sep 2008 15:49:47 +0000 (11:49 -0400)
committerJames Morris <jmorris@namei.org>
Wed, 3 Sep 2008 22:35:13 +0000 (08:35 +1000)
commit371feef6ee82ed7a3274259b8a131c1a92627698
treed618b12f26648de917cbec53677c734362e6bfc2
parenta7a7c8f93eeee976e5bbb3698c814a1b282da6a8
SELinux: memory leak in security_context_to_sid_core

Fix a bug and a philosophical decision about who handles errors.

security_context_to_sid_core() was leaking a context in the common case.
This was causing problems on fedora systems which recently have started
making extensive use of this function.

In discussion it was decided that if string_to_context_struct() had an
error it was its own responsibility to clean up any mess it created
along the way.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
security/selinux/ss/services.c