Is there something wrong with this code?LINKED lists C++
 void deletemiddle()
    {   list *newlist;
        newlist = first;

        if (current == first)
      {
       list *deleteme = first;
       first = first->next;
       delete deleteme;
       current = current->next;
      }
       else
       {
          while (newlist != NULL && newlist->next != current)
           newlist = newlist->next;
        if(newlist != NULL)
         {
             delete newlist->next;
             newlist->next = current->next;
             if (current->next == NULL)
             current=first;
             else
             current=current->next;
         }
       }

   }


this is the code I use to delete a node from a linked list. (Current and first are both declared to be NULL at the start of the node structure code)
I was wondering if there was something wrong with this code.
If so can somoone show me the correction?
Is there something wrong with this code?LINKED lists C++
===

 void deletemiddle()
    {   list *newlist;
        newlist = first;

        if (current == first)
      {
       list *deleteme = first;
       first = first->next;
       delete deleteme;
       current = current->next;
      }
       else
       {
          while (newlist != NULL && newlist->next != current)
           newlist = newlist->next;
        if(newlist != NULL)
         {
             delete newlist->next;
             newlist->next = current->next;
             if (current->next == NULL)
             current=first;
             else
             current=current->next;
         }
       }

   }


this is the code I use to delete a node from a linked list. (Current and first are both declared to be NULL at the start of the node structure code)
I was wondering if there was something wrong with this code.
If so can somoone show me the correction?