summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-24 12:32:12 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-24 12:32:12 -0700
commit6e8a43c8432649686921b57255db8172edcebf6f (patch)
tree57867bdcb71b5bd0339f822ddb8032974a37a822
parentb2e961eb2e7a54ffaae82f8e0198b26b54ade98e (diff)
parent0ec8abd7086ee4f760cb1b477fe376805b17558c (diff)
downloadop-kernel-dev-6e8a43c8432649686921b57255db8172edcebf6f.zip
op-kernel-dev-6e8a43c8432649686921b57255db8172edcebf6f.tar.gz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6: SELinux: fix memory leak in security_netlbl_cache_add()
-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 b5f017f..0ae032f3 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,
cache->type = NETLBL_CACHE_T_MLS;
if (ebitmap_cpy(&cache->data.mls_label.level[0].cat,
- &ctx->range.level[0].cat) != 0)
+ &ctx->range.level[0].cat) != 0) {
+ kfree(cache);
return;
+ }
cache->data.mls_label.level[1].cat.highbit =
cache->data.mls_label.level[0].cat.highbit;
cache->data.mls_label.level[1].cat.node =
OpenPOWER on IntegriCloud