svn commit: r264804 - stable/10/sys/netpfil/ipfw

Christian Brueffer brueffer at FreeBSD.org
Wed Apr 23 07:22:41 UTC 2014


Author: brueffer
Date: Wed Apr 23 07:22:40 2014
New Revision: 264804
URL: http://svnweb.freebsd.org/changeset/base/264804

Log:
  MFC: r264421
  
  Free resources in error cases; re-indent a curly brace while here.
  
  CID:		1199366
  Found with:	Coverity Prevent(tm)

Modified:
  stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c
==============================================================================
--- stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c	Wed Apr 23 05:57:45 2014	(r264803)
+++ stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c	Wed Apr 23 07:22:40 2014	(r264804)
@@ -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;


More information about the svn-src-all mailing list