Why do I get a segmentation fault from this code?
int create_user(const char *name, User **user_ptr_add) {
    // Check length
    if (strlen(name) > MAX_NAME) {
        return 2;
    }

    // Search for given User
    if (find_user(name, *user_ptr_add) != NULL) {
        return 1;
    }

    // Create User
    User *new_user = malloc(sizeof(User));
    strncpy(new_user->name, name, MAX_NAME);
    User *curr = *user_ptr_add;
    while (curr->next != NULL) {
        curr = curr->next;
    }
    curr->next = new_user;
    return 0;
}