Blame SOURCES/checkpolicy-fedora.patch

578be6
diff --git checkpolicy-2.8/module_compiler.c checkpolicy-2.8/module_compiler.c
578be6
index 155702f..ada7cb2 100644
578be6
--- checkpolicy-2.8/module_compiler.c
578be6
+++ checkpolicy-2.8/module_compiler.c
578be6
@@ -802,6 +802,7 @@ int require_class(int pass)
578be6
 	if ((datum = calloc(1, sizeof(*datum))) == NULL ||
578be6
 	    symtab_init(&datum->permissions, PERM_SYMTAB_SIZE)) {
578be6
 		yyerror("Out of memory!");
578be6
+		class_datum_destroy(datum);
578be6
 		return -1;
578be6
 	}
578be6
 	ret =
578be6
diff --git checkpolicy-2.8/policy_define.c checkpolicy-2.8/policy_define.c
578be6
index d8788a6..ece10e7 100644
578be6
--- checkpolicy-2.8/policy_define.c
578be6
+++ checkpolicy-2.8/policy_define.c
578be6
@@ -1107,6 +1107,11 @@ int define_level(void)
578be6
 			    (cat_datum_t *) hashtab_search(policydbp->p_cats.
578be6
 							   table,
578be6
 							   (hashtab_key_t) id);
578be6
+			if (!cdatum) {
578be6
+				yyerror2("unknown category %s", id);
578be6
+				free(id);
578be6
+				return -1;
578be6
+			}
578be6
 			range_start = range_end = cdatum->s.value - 1;
578be6
 		}
578be6