Only check destination buffer for NULL if length argument did not already indicate the buffer needs to be allocated.