does this cause a memory leak
User *find_user(const char *name, const User *head) {
    // Create a pointer to traverse the list
    User *curr = (User *)head;

    // Traverse the list until the end
    while (curr != NULL) {
        // If the name matches the name of the current element, return
        // the element
        if (strcmp(curr->name, name) == 0) {
            return curr;
        }
        curr = curr->next;
    }

    // If end of the list is reached and user is not found, return NULL
    return NULL;
}