why is this code causing a segmentation fault
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;
}