Why am I getting a segmentation fault?
while (fgets(curr_line, MAXLINE, fp) != NULL) {
    if ((curr_line[0] != ' ') && (curr_line[0] != '\t') && (strchr(curr_line, '#') == NULL) && (strchr(curr_line, ':') != NULL)) {
        char *target_token = strtok(curr_line, ":");
        char *target_name = target_token;

        Dependency *curr_dependency = NULL;

        while (target_token != NULL) {
            target_token = strtok(NULL, " ");
            Rule *target_rule = curr_rule;

            while (target_rule != NULL && strcmp(target_rule->target, target_name) != 0) {
                target_rule = target_rule->next_rule;
            }

            Rule *dependency_rule = curr_rule;
            while (dependency_rule != NULL && strcmp(dependency_rule->target, target_token) != 0) {
                dependency_rule = dependency_rule->next_rule;
            }

            Dependency *new_dependency = malloc(sizeof(Dependency));
            new_dependency->rule = dependency_rule;
            new_dependency->next_dep = NULL;

            if (curr_dependency == NULL) {
                target_rule->dependencies = new_dependency;
                curr_dependency = new_dependency;
            } else {
                curr_dependency->next_dep = new_dependency;
            }
        }
    }