diff --git a/libsepol/src/module_to_cil.c b/libsepol/src/module_to_cil.c index 1b56d1b5..77e1219b 100644 --- a/libsepol/src/module_to_cil.c +++ b/libsepol/src/module_to_cil.c @@ -212,7 +212,12 @@ static void list_destroy(struct list **list) static void role_list_destroy(void) { - struct list_node *curr = role_list->head; + struct list_node *curr; + + if (role_list == NULL) { + return; + } + curr = role_list->head; while (curr != NULL) { free(curr->data);