Fix bad dealloctor

Memory allocated by malloc() should be deallocated by free(), not 'delete'

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>