why am i getting a segfault when create_rule is called
Rule *parse_file(FILE *fp) {
    char line[MAXLINE];
    Rule *curr_rule = NULL;
    Rule *head_rule = NULL;
    int num_actions = 0;

    // Iterate through each line of the makefile
    while (fgets(line, sizeof(line), fp) != NULL) {
        // Process newline characters
        line[strcspn(line, "\r")] = '\0';
        line[strcspn(line, "\n")] = '\0';

        if ((line[0] != ' ') && (line[0] != '\t') && (line[0] != '#')) {  // If is action line
            char *tok_line = strtok(line, " ");                           // Tokenize the line
            num_actions = 0;                                              // Initialize the number of actions (back to) 0

            if (find_rule(tok_line, head_rule) == NULL) {  // If rule doesn't exist
                curr_rule = create_rule(tok_line);         // Make a rule, set it to curr
            } else {
                curr_rule = find_rule(tok_line, head_rule);  // Find the rule, set it to curr
            }

            while ((strcmp(tok_line, ":")) && (tok_line != NULL)) {  // Iterate thru dependencies
                tok_line = strtok(NULL, " ");
                Dependency *new_dep = malloc(sizeof(Dependency));  // Dynamically allocate space for a dependency

                // Find or create a rule and assign it to the new dependency
                if (find_rule(tok_line, head_rule) == NULL) {
                    new_dep->rule = create_rule(tok_line);
                } else {
                    new_dep->rule = find_rule(tok_line, head_rule);
                }
                new_dep->next_dep = NULL;  // Initialize next_dep to NULL

                // Add it to curr's list of dependencies
                if (curr_rule->dependencies == NULL) {
                    curr_rule->dependencies = new_dep;
                } else {
                    Dependency *curr_dep = curr_rule->dependencies;
                    while (curr_dep->next_dep != NULL) {
                        curr_dep = curr_dep->next_dep;
                    }
                    curr_dep->next_dep = new_dep;
                }
            }

            // Add the rule to the linked list
            if (head_rule == NULL) {
                head_rule = curr_rule;
            } else {
                Rule *curr = head_rule;
                while (curr->next_rule != NULL) {
                    curr = curr->next_rule;
                }
                curr->next_rule = curr_rule;
            }
