aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/netfilter/ip_nat_snmp_basic.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c
index c62253845538..688a2f29fadf 100644
--- a/net/ipv4/netfilter/ip_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c
@@ -1003,12 +1003,12 @@ static unsigned char snmp_trap_decode(struct asn1_ctx *ctx,
1003 1003
1004 return 1; 1004 return 1;
1005 1005
1006err_addr_free:
1007 kfree((unsigned long *)trap->ip_address);
1008
1006err_id_free: 1009err_id_free:
1007 kfree(trap->id); 1010 kfree(trap->id);
1008 1011
1009err_addr_free:
1010 kfree((unsigned long *)trap->ip_address);
1011
1012 return 0; 1012 return 0;
1013} 1013}
1014 1014
@@ -1126,11 +1126,10 @@ static int snmp_parse_mangle(unsigned char *msg,
1126 struct snmp_v1_trap trap; 1126 struct snmp_v1_trap trap;
1127 unsigned char ret = snmp_trap_decode(&ctx, &trap, map, check); 1127 unsigned char ret = snmp_trap_decode(&ctx, &trap, map, check);
1128 1128
1129 /* Discard trap allocations regardless */ 1129 if (ret) {
1130 kfree(trap.id); 1130 kfree(trap.id);
1131 kfree((unsigned long *)trap.ip_address); 1131 kfree((unsigned long *)trap.ip_address);
1132 1132 } else
1133 if (!ret)
1134 return ret; 1133 return ret;
1135 1134
1136 } else { 1135 } else {