getNewMemBuffer memsets the buffer to zeros,
the caller don't have to initialize it.