malloc/free read buffer