Date: Wed, 23 Apr 2014 07:24:01 +0000 (UTC) From: Christian Brueffer <brueffer@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r264805 - stable/9/sys/netpfil/ipfw Message-ID: <201404230724.s3N7O1Q1088609@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brueffer Date: Wed Apr 23 07:24:01 2014 New Revision: 264805 URL: http://svnweb.freebsd.org/changeset/base/264805 Log: MFC: r264421 Free resources in error cases; re-indent a curly brace while here. CID: 1199366 Found with: Coverity Prevent(tm) Modified: stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/netpfil/ (props changed) Modified: stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Apr 23 07:22:40 2014 (r264804) +++ stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Apr 23 07:24:01 2014 (r264805) @@ -1043,8 +1043,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 { @@ -1060,11 +1062,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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404230724.s3N7O1Q1088609>