Fixing possible memory leaks caused by skip-init pass