This is not going to go anywhere, you start at the head and if that's not empty then you say "keep going while next is empty". If next is not empty you'll still stay at the head.
To add at the end of the list you'll need something like:
else
{
while(curr->next != NULL) // keep going while curr->next is not null
{
curr = curr->next; // advance the pointer
}
// Here curr->next will definitely be null
curr->next = newnode; // now point curr->next to the new node
}
Someone already pointed out that in the case of curr == NULL in the first check, once you do the assignment you don't return the pointer and head never gets initialised.
You can get away with that either by having head declared outside the scope of this function, or have a pointer to a pointer in your function signature, e.g.:
int add_node(struct node** head) // I'll assume this is how you've declared your add function
// ^^ notice the pointer to pointer
{
struct node* curr = *head; // curr assignment changes slightly
struct node* newnode = malloc(sizeof(struct node));
newnode->data = item;
newnode->next = NULL;
if (curr == NULL)
{
*head = newnode; // this will dereference the pointer to the pointer and update head without returning anything
}
The rest stays the same.