I'm getting a segmentation fault at line 27. Why?
int create_user(const char *name, User **user_ptr_add) {
    // MAX_NAME - 1 since we need the null terminator in a name, we need the last char to be \0
    if (strlen(name) > MAX_NAME - 1) {
        return 2;
    }

    // Head of the linked list
    User *curr = *user_ptr_add;

    // Case where curr is null
    if (curr == NULL) {
        User *user = malloc(sizeof(User));
        strncpy(user->name, name, MAX_NAME - 1);
        curr = user;
        return 0;
    }

    // Keep looping until curr is null
    while (curr != NULL) {

        // Return if curr has the same name as name i.e. name alraedy exists in linked list
        if (curr->name == name) {
            return 1;
        }

        // Add a new user with name as name to end of list if we reach the end of the linked list
        if (curr->next == NULL) {
            User *user = malloc(sizeof(User));
            strncpy(user->name, name, MAX_NAME - 1);
            user->name[MAX_NAME - 1] = '\0';
            curr->next = user;
            return 0;
        }

        // Keep traversing linked list
        curr = curr->next;
    }
}