Creates a new buffer with target size.
The caller should deallocate it when necessary.
The size of the new buffer to be created
The newly created buffer with the target size.