Blob Blame Raw
diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-1.21.9/src/matchpathcon.c
--- nsalibselinux/src/matchpathcon.c	2005-02-17 14:22:28.000000000 -0500
+++ libselinux-1.21.9/src/matchpathcon.c	2005-02-11 02:36:46.000000000 -0500
@@ -553,29 +553,27 @@
 		nspec = 0;
 		while (fgets_unlocked(line_buf, sizeof line_buf, fp) && nspec < maxnspec) {
 			if (process_line(path, line_buf, pass, ++lineno) != 0)
-				goto finish;
+				return -1;
 		}
 		if (homedirfp) 
 			while (fgets_unlocked(line_buf, sizeof line_buf, homedirfp) && nspec < maxnspec) {
 				if (process_line(homedir_path, line_buf, pass, ++lineno) != 0)
-					goto finish;
+					return -1;
 			}
 
 
 		if (localfp) 
 			while (fgets_unlocked(line_buf, sizeof line_buf, localfp) && nspec < maxnspec) {
 				if (process_line(local_path, line_buf, pass, ++lineno) != 0)
-					goto finish;
+					return -1;
 			}
 
 		if (pass == 0) {
-			if (nspec == 0) {
-				status = 0;
-				goto finish;
-			}
+			if (nspec == 0)
+				return 0;
 			if ((spec_arr = malloc(sizeof(spec_t) * nspec)) ==
 			    NULL)
-				goto finish;
+				return -1;
 			memset(spec_arr, '\0', sizeof(spec_t) * nspec);
 			maxnspec = nspec;
 			rewind(fp);
@@ -583,11 +581,13 @@
 			if (localfp) rewind(localfp);
 		}
 	}
-
+	fclose(fp);
+	if (homedirfp) fclose(homedirfp);
+	if (localfp) fclose(localfp);
 	/* Move exact pathname specifications to the end. */
 	spec_copy = malloc(sizeof(spec_t) * nspec);
 	if (!spec_copy)
-		goto finish;
+		return -1;
 	j = 0;
 	for (i = 0; i < nspec; i++) {
 		if (spec_arr[i].hasMetaChars)
@@ -602,13 +602,7 @@
 
 	nodups_specs(path);
 
-	status = 0;
- finish:
-	fclose(fp);
-	if (spec_arr != spec_copy) free(spec_arr);
-	if (homedirfp) fclose(homedirfp);
-	if (localfp) fclose(localfp);
-	return status;
+	return 0;
 }
 hidden_def(matchpathcon_init)