Merge "fix memory leak in copy_remote_dir_local"