summaryrefslogtreecommitdiffstats
path: root/sys/netpfil
diff options
context:
space:
mode:
authorbrueffer <brueffer@FreeBSD.org>2014-04-23 07:22:40 +0000
committerbrueffer <brueffer@FreeBSD.org>2014-04-23 07:22:40 +0000
commit4bf359bbbf2801929c937ed987d9d34bd645d104 (patch)
treef4998953047470c1b9c4eb9663ee5316708ff6d8 /sys/netpfil
parentec059ac88645aac84502639d9e1a2d8a4f00cdfc (diff)
downloadFreeBSD-src-4bf359bbbf2801929c937ed987d9d34bd645d104.zip
FreeBSD-src-4bf359bbbf2801929c937ed987d9d34bd645d104.tar.gz
MFC: r264421
Free resources in error cases; re-indent a curly brace while here. CID: 1199366 Found with: Coverity Prevent(tm)
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 64f09a5..cb9c89c 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