Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f937f1f46b6d2f9bef94e0d6b769a4c67615d34e
Commit:     f937f1f46b6d2f9bef94e0d6b769a4c67615d34e
Parent:     1dff92e09eb3adfcf3d3dffd0507b850f911f280
Author:     Jesper Juhl <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 15 01:39:12 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 15 12:26:32 2007 -0700

    [NETLINK]: Don't leak 'listeners' in netlink_kernel_create()
    
    The Coverity checker spotted that we'll leak the storage allocated
    to 'listeners' in netlink_kernel_create() when the
      if (!nl_table[unit].registered)
    check is false.
    
    This patch avoids the leak.
    
    Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]>
    Acked-by: "Eric W. Biederman" <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/netlink/af_netlink.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c776bcd..98e313e 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1378,6 +1378,8 @@ netlink_kernel_create(struct net *net, int unit, unsigned 
int groups,
                nl_table[unit].cb_mutex = cb_mutex;
                nl_table[unit].module = module;
                nl_table[unit].registered = 1;
+       } else {
+               kfree(listeners);
        }
        netlink_table_ungrab();
 
-
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