is there a segmentation fault
Rule *find_rule(char *rule, Rule *head) {
    Rule *curr = head;
    while (curr != NULL) {
        if (strcmp(rule, curr->target) == 0) {
            return curr;
        }
        curr = curr->next_rule;
    }
    return NULL;
}