why does my while loop run forever
#define MAX_NAME 32     // Max username and profile_pic filename lengths
#define MAX_FRIENDS 10  // Max number of friends a user can have

typedef struct user {
    char name[MAX_NAME];
    char profile_pic[MAX_NAME];  // This is a *filename*, not the file contents.
    struct post *first_post;
    struct user *friends[MAX_FRIENDS];
    struct user *next;
} User;

/*
 * Create a new user with the given name.  Insert it at the tail of the list
 * of users whose head is pointed to by *user_ptr_add.
 *
 * Return:
 *   - 0 if successful
 *   - 1 if a user by this name already exists in this list
 *   - 2 if the given name cannot fit in the 'name' array
 *       (don't forget about the null terminator)
 */
int create_user(const char *name, User **user_ptr_add) {
    User *curr = *user_ptr_add;
    User *new_user = malloc(sizeof(User));

    // Check if memory allocation was successful; exits if not.
    if (new_user == NULL) {            
        exit(1);
    }

    if (strlen(name) >= MAX_NAME) {
        free(new_user);
        return 2;
    } else if (curr == NULL) {

        *user_ptr_add = new_user;
        new_user->next = *user_ptr_add;

    } else {
        User *next = curr -> next;

        // While loop to check if the name is already in the list.
        while (next != NULL) {
            if (strcmp(name, next->name) != 0) {
                curr = curr -> next;
                next = curr -> next;
            } else {
                free(new_user);
                return 1;
            }

        }

        curr->next = new_user;
        new_user->next = NULL;

    }

    new_user->profile_pic[0] = '\0';
    strcpy(new_user->name, name);
    for (int i=0; i < MAX_FRIENDS; i++) {
        new_user->friends[i] = NULL;
    }
    new_user->first_post = NULL;

    return 0;
}