From: Jesper Juhl 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 Cc: Patrick McHardy Cc: "David S. Miller" Signed-off-by: Andrew Morton --- net/ipv4/netfilter/ipt_recent.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN net/ipv4/netfilter/ipt_recent.c~fix-mem-leak-in-netfilter net/ipv4/netfilter/ipt_recent.c --- devel/net/ipv4/netfilter/ipt_recent.c~fix-mem-leak-in-netfilter 2006-05-10 21:56:53.000000000 -0700 +++ devel-akpm/net/ipv4/netfilter/ipt_recent.c 2006-05-10 21:56:53.000000000 -0700 @@ -821,6 +821,7 @@ checkentry(const char *tablename, /* Create our proc 'status' entry. */ curr_table->status_proc = create_proc_entry(curr_table->name, ip_list_perms, proc_net_ipt_recent); if (!curr_table->status_proc) { + vfree(hold); printk(KERN_INFO RECENT_NAME ": checkentry: unable to allocate for /proc entry.\n"); /* Destroy the created table */ spin_lock_bh(&recent_lock); @@ -845,7 +846,6 @@ checkentry(const char *tablename, spin_unlock_bh(&recent_lock); vfree(curr_table->time_info); vfree(curr_table->hash_table); - vfree(hold); vfree(curr_table->table); vfree(curr_table); return 0; _