why am I getting a segmentation fault? 
if (strcmp(curr->name,name)==0){
                prev->next=curr->next;

                //remove user from friend lists
                for(int i=0; i<MAX_FRIENDS;i++){

                        //find this user within friends' lists
                        User *f=curr->friends[i];
                        if(f!=NULL){
                                int j =0;
                                while(f->friends[j]!=NULL && strcmp(f->friends[j]->name,name)!=0){
                                j+=1;
                                }
                                if (strcmp(f->friends[j]->name,name)==0){
                                        //shift friends forward to get rid of this user
                                        //      while(j<MAX_FRIENDS-1){
                                        //      f->friends[j]=f->friends[j+1];
                                        //      j+=1;
                                        //      }

                                }

                        }
                }
                free(curr);
                return 0;
