summaryrefslogtreecommitdiffstats
path: root/sys/netpfil
diff options
context:
space:
mode:
authorbrueffer <brueffer@FreeBSD.org>2014-04-13 21:13:33 +0000
committerbrueffer <brueffer@FreeBSD.org>2014-04-13 21:13:33 +0000
commitf19c513644979fe46f73eef13e168f02386a52d8 (patch)
treeb62538dfccd5e7f0ab24844ac8b0db2093a694f1 /sys/netpfil
parentf53a57bcab03b6dd867e85c4243ac4a1c2c83c13 (diff)
downloadFreeBSD-src-f19c513644979fe46f73eef13e168f02386a52d8.zip
FreeBSD-src-f19c513644979fe46f73eef13e168f02386a52d8.tar.gz
Free resources and error cases; re-indent a curly brace while here.
CID: 1199366 Found with: Coverity Prevent(tm) MFC after: 1 week
Diffstat (limited to 'sys/netpfil')
-rw-r--r--sys/netpfil/ipfw/ip_fw_sockopt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c
index 0d619bc..3c342f7 100644
--- a/sys/netpfil/ipfw/ip_fw_sockopt.c
+++ b/sys/netpfil/ipfw/ip_fw_sockopt.c
@@ -1039,8 +1039,10 @@ ipfw_ctl(struct sockopt *sopt)
if (sopt->sopt_valsize == RULESIZE7(rule)) {
is7 = 1;
error = convert_rule_to_8(rule);
- if (error)
+ if (error) {
+ free(rule, M_TEMP);
return error;
+ }
if (error == 0)
error = check_ipfw_struct(rule, RULESIZE(rule));
} else {
@@ -1056,11 +1058,13 @@ ipfw_ctl(struct sockopt *sopt)
if (is7) {
error = convert_rule_to_7(rule);
size = RULESIZE7(rule);
- if (error)
+ if (error) {
+ free(rule, M_TEMP);
return error;
+ }
}
error = sooptcopyout(sopt, rule, size);
- }
+ }
}
free(rule, M_TEMP);
break;
OpenPOWER on IntegriCloud