Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0ec8abd7086ee4f760cb1b477fe376805b17558c
Commit:     0ec8abd7086ee4f760cb1b477fe376805b17558c
Parent:     f695baf2df9e0413d3521661070103711545207a
Author:     Jesper Juhl <[EMAIL PROTECTED]>
AuthorDate: Sat Jul 21 00:12:44 2007 +0200
Committer:  James Morris <[EMAIL PROTECTED]>
CommitDate: Mon Jul 23 09:35:37 2007 -0400

    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 <[EMAIL PROTECTED]>
    Signed-off-by: James Morris <[EMAIL PROTECTED]>
    Acked-by:  Stephen Smalley <[EMAIL PROTECTED]>
---
 security/selinux/ss/services.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index b5f017f..0ae032f 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 =
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to