Fix memleaks, the result table must be freed

Signed-off-by: Neutron Soutmun <neo.neutron@gmail.com>