Don't leak 'listeners' in netlink_kernel_create()
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Eric W. Biederman
Acked-byQuoted 8 lines · Jesper Juhl
From: Jesper Juhl <[email protected]>
Subject: Don't leak 'listeners' innetlink_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.
Quoted 4 lines
This patch avoids the leak.
Signed-off-by Jesper Juhl <[email protected]>
This patch appears trivially correct to me.
Quoted 16 lines
---
af_netlink.c | 2 ++ 1 file changed, 2 insertions(+)net/netlink/af_netlink.c renamed from net/netlink/af_netlink.c~ +2
-0@@ -1378,6 +1378,8 @@ netlink_kernel_create(struct net *net, i nl_table[unit].cb_mutex = cb_mutex; nl_table[unit].module = module; nl_table[unit].registered =1 ; + }else { +kfree (listeners); }netlink_table_ungrab ();
From: [email protected] (Eric W. Biederman)
Date: Sun, 14 Oct 2007 16:30:06 -0600
Quoted 10 lines
Quoted 8 lines · Jesper Juhl
From: Jesper Juhl <[email protected]>
Subject: Don't leak 'listeners' innetlink_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.
Quoted 7 lines
Quoted 4 lines
This patch avoids the leak.
Signed-off-by Jesper Juhl <[email protected]>This patch appears trivially correct to me.
Applied, thanks everyone.