int create_user(const char *name, User **user_ptr_add) {
    User *curr = *user_ptr_add;
    int res = 0;
    while (curr->next){
        if (strcmp(curr->name, name) == 0){
            res = 1;
        }
        curr = curr->next;
    }
    if (res == 1){
        return res;
    }
    if (strlen(name) > MAX_NAME - 1){
        return 2;
    }
    User *u1ptr = malloc(sizeof(User));
    strcpy(u1ptr->name,name);
    for (int i =0; i <10; i++){
        u1ptr->friends[i] = NULL;
    }
    u1ptr->next = NULL;
    u1ptr->first_post = NULL;
    strcpy(u1ptr->profile_pic,"");
    curr->next = u1ptr;
    return 0;
}
how to solve the segmentation fault.