fix some memory leak

fix some memory leak