fix bug

free cache->table and cache itself