fix 28 issues about memory leaks