[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1275303998-2435-1-git-send-email-dfeng@redhat.com>
Date: Mon, 31 May 2010 19:06:38 +0800
From: Xiaotian Feng <dfeng@...hat.com>
To: netfilter-devel@...r.kernel.org, netfilter@...r.kernel.org,
coreteam@...filter.org
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Xiaotian Feng <dfeng@...hat.com>,
Patrick McHardy <kaber@...sh.net>,
"David S. Miller" <davem@...emloft.net>,
Jan Engelhardt <jengelh@...ozas.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Alexey Dobriyan <adobriyan@...il.com>
Subject: [PATCH] netfilter: don't xt_jumpstack_alloc twice in xt_register_table
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 <dfeng@...hat.com>
Cc: Patrick McHardy <kaber@...sh.net>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Jan Engelhardt <jengelh@...ozas.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Rusty Russell <rusty@...tcorp.com.au>
Cc: Alexey Dobriyan <adobriyan@...il.com>
---
net/netfilter/x_tables.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 445de70..47b1e79 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -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) {
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists