close src/dst in defer