Is there a segmentation fault in this
Rule *find_rule(Rule **rules_ptr, char *name) {
        Rule *curr = *rules_ptr;
        while(curr->next_rule != NULL) {
                if (strcmp(curr->target, name) == 0) {
                        break;
                }
                curr = curr->next_rule;
        }

        if (strcmp(curr->target, name) != 0) { // rule doesn't exist
                curr->next_rule = init_rule(name);
                curr = curr->next_rule;
        }

        return curr;
}