Fix a UB in TMemoryBuffer
Fix a UB in TMemoryBuffer

Summary: Passing a null pointer to `memcpy` is a UB even if `size` is 0: https://en.cppreference.com/w/cpp/string/byte/memcpy. Fix the UB by adding an extra check.

Reviewed By: steaphangreene

Differential Revision: D15989533

fbshipit-source-id: 4aa721424bfa35ef7587035e9c00fae8ef56e087

facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift