Switched to using a simple malloc'd buffer