aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2007-07-20 18:12:44 -0400
committerJames Morris <jmorris@namei.org>2007-07-23 09:35:37 -0400
commit0ec8abd7086ee4f760cb1b477fe376805b17558c (patch)
tree09eff2e119de344244242788eab5b6514191f040 /security/selinux/ss
parentf695baf2df9e0413d3521661070103711545207a (diff)
SELinux: fix memory leak in security_netlbl_cache_add()
Fix memory leak in security_netlbl_cache_add() Note: The Coverity checker gets credit for spotting this one. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: James Morris <jmorris@namei.org> Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Diffstat (limited to 'security/selinux/ss')
-rw-r--r--security/selinux/ss/services.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index b5f017f07a75..0ae032f3876b 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -2417,8 +2417,10 @@ static void security_netlbl_cache_add(struct netlbl_lsm_secattr *secattr,
2417 2417
2418 cache->type = NETLBL_CACHE_T_MLS; 2418 cache->type = NETLBL_CACHE_T_MLS;
2419 if (ebitmap_cpy(&cache->data.mls_label.level[0].cat, 2419 if (ebitmap_cpy(&cache->data.mls_label.level[0].cat,
2420 &ctx->range.level[0].cat) != 0) 2420 &ctx->range.level[0].cat) != 0) {
2421 kfree(cache);
2421 return; 2422 return;
2423 }
2422 cache->data.mls_label.level[1].cat.highbit = 2424 cache->data.mls_label.level[1].cat.highbit =
2423 cache->data.mls_label.level[0].cat.highbit; 2425 cache->data.mls_label.level[0].cat.highbit;
2424 cache->data.mls_label.level[1].cat.node = 2426 cache->data.mls_label.level[1].cat.node =