Why segmentation fault ?
typedef struct user {
    char name[MAX_NAME];
    char profile_pic[MAX_NAME];  // This is a *filename*, not the file contents.
    struct post *first_post;
    struct user *friends[MAX_FRIENDS];
    struct user *next;
} User;

int create_user(const char *name, User **user_ptr_add) {
    User *curr_user_ptr = *user_ptr_add;
    while(curr_user_ptr->next != NULL) {
        if(curr_user_ptr->name == name) {
            return 1;
        }
        curr_user_ptr = curr_user_ptr->next;
    }
    if(strlen(name) > 31) {
        return 2;
    }
    User *new_user_ptr = malloc(sizeof(User));
    new_user_ptr =  curr_user_ptr->next;
    strncpy(new_user_ptr->name,name, 32);
    // new_user_ptr->profile_pic = NULL;
    new_user_ptr->first_post = NULL;
    // new_user_ptr->friends = NULL;
    new_user_ptr->next = NULL;
    return 0;
}