will this cause segmentation fault?

while (curr->dependencies->next_dep != NULL) {
    curr->dependencies = curr->dependencies->next_dep;
}

if (curr->dependencies != NULL) {
    curr->dependencies->next_dep = dep;
}