What is wrong with my find rule function

Rule* find_rule(Rule** head, char* target) {
    // printf("last rule %s \n", target);
    Rule* curr = *head;
    while (curr != NULL) {
        if (strcmp(curr->target, target) == 0) {
            return curr;
        }
        curr = curr->next_rule;
    }
    return NULL;
}