Why am i getting a segmentation fault
typedef struct post {
    char author[MAX_NAME];
    char *contents;
    time_t *date;
    struct post *next;
} Post;

Post *create_post(char *contents) {
    Post *new_post = malloc(sizeof(Post));
    if(new_post == NULL) {
            printf("Error: Memory cannot be allocated");
            exit(1);
    }
    strcpy(new_post->contents, contents);

    return new_post;
}

int make_post(const User *author, User *target, char *contents) {
    // return 2 if either User pointer is NULL
    if (author == NULL || target == NULL) {
        return 2;
    }
    //////////////////////////////////////////////////////////////////
    // return 1 if users exist but are not friends
    int are_friends = 0;
    User *curr_friend = *(author->friends);
    while(curr_friend != NULL) {
        // if target is in author's friendlist, are_friends is true
        if(curr_friend == target) {
            are_friends = 1;
        }
        curr_friend = curr_friend->next;
    }
    // users are not friends since target is not in author's friendlist
    if (are_friends == 0) {
        return 1;
    }
    //////////////////////////////////////////////////////////////////
    // insert new post at front of user's list of posts
    Post *new_post = create_post(contents);
    
    // put in contents, author, date
    strcpy(new_post->author, author->name);
    /*
    // time_t cur_time = time(NULL);
    // printf("time: %s\n", ctime(&cur_time));
    time_t date = time(&date);
    new_post->date = &date;
    // make next of new_post the front
    new_post->next = target->first_post;
    // make target->first_post point to the new_post
    target->first_post = new_post;
    // return 0 on success
    */
    return 0;
    return -1;
}