[BUG] fix double free