[NETFILTER]: Fix memory leak in ipt_recent
authorJesper Juhl <jesper.juhl@gmail.com>
Fri, 19 May 2006 09:15:13 +0000 (02:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 May 2006 09:15:13 +0000 (02:15 -0700)
commit493e2428aa1db0e592736ad15885c6ed1e81b8af
treeabfa2a9540b4c84ce0cb33819398a792e3914ed9
parenta54c9d30dbb06391ec4422aaf0e1dc2c8c53bd3e
[NETFILTER]: Fix memory leak in ipt_recent

The Coverity checker spotted that we may leak 'hold' in
net/ipv4/netfilter/ipt_recent.c::checkentry() when the following
is true:
  if (!curr_table->status_proc) {
    ...
    if(!curr_table) {
    ...
      return 0;  <-- here we leak.
Simply moving an existing vfree(hold); up a bit avoids the possible leak.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter/ipt_recent.c