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