Resource leaks fix when no args

Resource leaks fix when no args