revert to using malloc/free for data buffer allocation in case external code wants to fiddle with it