88d65cb13d
Motivation: Currently we do more memory copies then needed. Modification: - Directly use heap buffers to reduce memory copy - Correctly release buffers to fix buffer leak Result: Less memory copies and no leaks