why is this giving me segmentation fault?
while (curr->dependencies->next_dep != NULL) {
    curr->dependencies = curr->dependencies->next_dep;
}

curr->dependencies->next_dep->rule = r2;

printf("%s\n", curr->dependencies->rule->target);