fixed memory leak in tmpcache_read