Fix example memory

fix some example memory leak