[apparmor] [patch 04/18] parser: remove unneeded goto target in build_mnt_opts() [resend]

Steve Beattie steve at nxnw.org
Thu Jan 16 22:06:12 UTC 2014


As noted by Seth Arnold, there's now only one failure case in the
function and thus does not warrant a goto target (especially since
there's no cleanup to occur).

Signed-off-by: Steve Beattie <steve at nxnw.org>
---
 parser/parser_regex.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Index: b/parser/parser_regex.c
===================================================================
--- a/parser/parser_regex.c
+++ b/parser/parser_regex.c
@@ -731,16 +731,13 @@ static int build_mnt_opts(std::string& b
 	list_for_each(opts, ent) {
 		ptype = convert_aaregex_to_pcre(ent->value, 0, buffer, &pos);
 		if (ptype == ePatternInvalid)
-			goto fail;
+			return FALSE;
 
 		if (ent->next)
 			buffer.append(",");
 	}
 
 	return TRUE;
-
-fail:
-	return FALSE;
 }
 
 static int process_mnt_entry(aare_ruleset_t *dfarules, struct mnt_entry *entry)




More information about the AppArmor mailing list