why is this giving me segmentation fault?
Rule *curr2 = head;
Rule *r = NULL;

while (curr2 != NULL) {
    if (curr2->target != NULL && strcmp(curr2->target, token) == 0) {
        r = curr2;
    }
    curr2 = curr2->next_rule;
}
