Remove duplicate from sorted linked list

struct node {
    int data;
    struct node* next;
};
 
void removeDuplicates (struct node* head)
{
   struct node* current = head;
   struct node* next_next; 
   
   if(current == NULL) 
      return; 
 
   while(current->next != NULL){
      if(current->data == current->next->data) 
      {
          next_next = current->next->next;
          free(current->next);
          current->next = next_next;  
       }
       else{
          current = current->next; 
       }
   }
}

Delete element from Linked List

struct node {
    int data;
    struct node *next;
};
 
void deleteNode(struct node *head, struct node *n)
{
    if(head == n)
    {
        if(head->next == NULL){
            return;
        }

        // Node to be deleted is head
        head->data = head->next->data;
        n = head->next;
        head->next = head->next->next;
        free(n);
    }
 
    // When not first node
    struct node *prev = head;
    while(prev->next != NULL && prev->next != n)
        prev = prev->next;
  
    prev->next = prev->next->next;
    free(n);
}