[fix] Fix some memory leaks