Do I need to free "rule"?
Rule *curr_rule = head_rule;
if (head_rule == NULL) {
    Rule *rule = malloc(sizeof(Rule));
    head_rule = rule;
    curr_rule = rule;
} else {
    while (curr_rule->next_rule != NULL) {
        if (strcmp(curr_rule->target, token) == 0) {
            break;
        }
        curr_rule = curr_rule->next_rule;
    }
    if (strcmp(curr_rule->target, token) != 0) {
        Rule *rule = malloc(sizeof(Rule));
        curr_rule->next_rule = rule;
        curr_rule = curr_rule->next_rule;
    }
}