mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 12:45:13 +02:00
TARPIT: fix memory leak when tarpit_generic() fails
Currently tarpit_generic() just returns on failure, but this does not free nskb. Signed-off-by: Josh Hunt <johunt@akamai.com>
This commit is contained in:

committed by
Jan Engelhardt

parent
37e3a543a9
commit
4ff5a8fbf6
@@ -3,6 +3,7 @@ HEAD
|
||||
====
|
||||
Fixes:
|
||||
- length2, SYSRQ, RAWNAT: preinitialize values for ipv6_find_hdr
|
||||
- TARPIT: fix memory leak when tarpit_generic() fails
|
||||
|
||||
|
||||
v1.45 (2012-07-16)
|
||||
|
@@ -237,7 +237,7 @@ static void tarpit_tcp4(struct sk_buff *oldskb, unsigned int hook,
|
||||
((u_int8_t *)tcph)[13] = 0;
|
||||
|
||||
if (!tarpit_generic(tcph, oth, payload, mode))
|
||||
return;
|
||||
goto free_nskb;
|
||||
|
||||
/* Adjust TCP checksum */
|
||||
tcph->check = 0;
|
||||
@@ -398,7 +398,7 @@ static void tarpit_tcp6(struct sk_buff *oldskb, unsigned int hook,
|
||||
|
||||
payload = nskb->len - sizeof(struct ipv6hdr) - sizeof(struct tcphdr);
|
||||
if (!tarpit_generic(&oth, tcph, payload, mode))
|
||||
return;
|
||||
goto free_nskb;
|
||||
|
||||
ip6h->payload_len = htons(sizeof(struct tcphdr));
|
||||
tcph->check = 0;
|
||||
|
Reference in New Issue
Block a user