Removing node from Dynamically linked list I am writing a program that saves strings into a linked list while allocating memory for both the string and the node. I have my insert and search functions working perfectly but I can't seem to get my delete function working. It doesn't seem to remove the information from the node but I am at a loss for what the set to what and what to free. Any help would be more than welcome even if it is just a hint.
My node and list struct
typedef struct listNode {//simple linked list   structure
struct listNode *next;//address to next
char *data;//data
} NODE;

typedef struct ListStruct {
   NODE *head;//head node for iterating
} LIST;

This is my current nonworking version of deleting a node
void deleteNode(LIST *list, char *string){// passed linked list and string to find
NODE *prev, *curr, *temp;//variables init
//int compare;// for strcmp if needed
prev = NULL;//set prev to null
curr = list->head;//set current to the head of the list
while(curr != NULL){//while the current node is not null
if(strcmp(curr->data,string) == 0){//check for the proper string 
    temp = curr;//set temp to current node to be deleted
    temp->data = strcpy(curr->data);//copy data so free is possible
    prev->next = temp;//set the prev to temp
    free(curr->data);//free malloc'd data
    free(curr);//free malloc'd node
    curr = temp;//set curr back to temp
}
else{//if string isn't found at current
    prev = curr;//set previous to current
    curr = curr->next;//and current to current.next
}   

}
}//done

I know that the error is when I find the proper string but I can't for the life of me figure out what is wrong. Hope to hear from someone soon and thank you as always.

You might want to update the if block a little bit:
if(strcmp(curr->data,string) == 0){//check for the proper string 
  temp = curr;//set temp to current node to be deleted
  if (prev == NULL)// if the first node is the one to be deleted
    list->head = curr->next;
  else
    prev->next = curr->next;//set prev next pointer to curr next node
  curr = curr->next;//curr updated
  free(temp->data);//free malloc'd data
  free(temp);//free malloc'd node

  break;   //assume there is only one unique string in the link list
}