is there a segmentation fault?
Rule *check_rule_in_list(Rule *rules, char *target) {
    Rule *curr = rules;

    while (curr != NULL && curr->next_rule != NULL) {
        if (strcmp(target, curr->target) == 0) {
            return curr;
        } else {
            curr = curr->next_rule;
        }
    }
    return curr;
}