where is the memory leak?
int create_user(const char *name, User **user_ptr_add) {
    User *curr = *user_ptr_add;

    //first, check if user with same name exists
    while(curr != NULL){
    	if (strcmp(curr->name, name) == 0){
    		return 1;
    	}
    	curr = curr->next;
    }

    // next, check if the name cannot fit in the 'name' array
    // the '-1' reserves space for the null terminator
    if (strlen(name) >= MAX_NAME - 1){
    	return 2;
    }

    // create a new user and add it to the end of the list
    User *new_user = (User *)malloc(sizeof(User));
    strcpy(new_user->name, name);
    new_user->next = NULL;

    // reset the current pointer
    curr = *user_ptr_add;
    if (curr == NULL) {
    	*user_ptr_add = new_user;
    }
    else {
    	while (curr->next != NULL){
    		curr = curr->next;
    	}
    	curr->next = new_user;
    }
    free(new_user);

    return 0;
}