Skip to content

Commit

Permalink
netfilter: don't xt_jumpstack_alloc twice in xt_register_table
Browse files Browse the repository at this point in the history
In xt_register_table, xt_jumpstack_alloc is called first, later
xt_replace_table is used. But in xt_replace_table, xt_jumpstack_alloc
will be used again. Then the memory allocated by previous xt_jumpstack_alloc
will be leaked. We can simply remove the previous xt_jumpstack_alloc because
there aren't any users of newinfo between xt_jumpstack_alloc and
xt_replace_table.

Signed-off-by: Xiaotian Feng <[email protected]>
Cc: Patrick McHardy <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Jan Engelhardt <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Acked-By: Jan Engelhardt <[email protected]>
Signed-off-by: Patrick McHardy <[email protected]>
  • Loading branch information
Xiaotian Feng authored and kaber committed May 31, 2010
1 parent 67a3e12 commit c936e8b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions net/netfilter/x_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,10 +844,6 @@ struct xt_table *xt_register_table(struct net *net,
struct xt_table_info *private;
struct xt_table *t, *table;

ret = xt_jumpstack_alloc(newinfo);
if (ret < 0)
return ERR_PTR(ret);

/* Don't add one object to multiple lists. */
table = kmemdup(input_table, sizeof(struct xt_table), GFP_KERNEL);
if (!table) {
Expand Down

0 comments on commit c936e8b

Please sign in to comment.