Fix. use malloc/free directly.