Skip to contentSkip to conversation

Fix possible leaks in netfilter.

PATCH New Dave Jones 1 participant 1 message Sep 1, 2004

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

PATCH 1/1 Fix possible leaks in netfilter.

Spotted with the source checker from Coverity.com.

net/ipv4/netfilter/ipt_recent.c +2 -0
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/net/ipv4/netfilter/ipt_recent.c linux-2.6/net/ipv4/netfilter/ipt_recent.c
@@ -827,6 +827,7 @@ checkentry(const char *tablename,
 			if(debug) printk(KERN_INFO RECENT_NAME ": checkentry() create_proc failed, no tables.\n");
 #endif
 			spin_unlock_bh(&recent_lock);
+			vfree(hold);
 			return -ENOMEM;
 		}
 		while( strncmp(info->name,curr_table->name,IPT_RECENT_NAME_LEN) && (last_table = curr_table) && (curr_table = curr_table->next) );
@@ -835,6 +836,7 @@ checkentry(const char *tablename,
 			if(debug) printk(KERN_INFO RECENT_NAME ": checkentry() create_proc failed, table already destroyed.\n");
 #endif
 			spin_unlock_bh(&recent_lock);
+			vfree(hold);
 			return -ENOMEM;
 		}
 		if(last_table) last_table->next = curr_table->next; else r_tables = curr_table->next;