typedef struct post {
    char author[MAX_NAME];
    char *contents;
    time_t *date;
    struct post *next;
} Post;

int make_post(const User *author, User *target, char *contents) {
    // either one or author or target names does not exist
    if (author == NULL || target == NULL) {
        return 2;
    }

    // loop through one user's friends
    int friends = 0;
    for (int i = 0; i < MAX_FRIENDS; i++) {
        if (author->friends[i] == target) {
            friends = 1;
        }
    }
    // users not friends, early return
    if (friends == 0) {
        return 1;
    }

    // checks passed, initialize a new post
    Post *new_post = malloc(sizeof(struct post));
    // malloc error check
    if (new_post == NULL) {
        exit(1);
    }
    strcpy(new_post->author, author->name);
    strcpy(new_post->contents, contents);
    time_t *curr_time = malloc(sizeof(time_t));
    new_post->date = curr_time;
    new_post->next = NULL;

    // 'send' post to target; pointer at head, takes care of both whether empty or not cases
    new_post->next = target->first_post;

    return 0;
}
how to get rid of error: "invalid write of size 1" in line 33