misc: multi code tidy
fix a mem leak bug