add new post, how to avoid memory leak