X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/9e31c4824cabb1bf173f87cbd0abe93f25ea9598..5be59dc5b269a84ea529b7f97652e48077286696:/rsync.c?ds=sidebyside diff --git a/rsync.c b/rsync.c index 647af677..18412488 100644 --- a/rsync.c +++ b/rsync.c @@ -395,7 +395,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out) write_flush(f_out); close(fd); - unmap_file(buf); + if (buf) unmap_file(buf); free_sums(s); } @@ -443,6 +443,7 @@ static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname) map = map_ptr(buf,offset2,len); + see_token(map, len); sum_update(map,len); if (write_sparse(fd,map,len) != len) { @@ -620,7 +621,7 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen) recv_ok = receive_data(f_in,buf,fd2,fname); if (fd1 != -1) { - unmap_file(buf); + if (buf) unmap_file(buf); close(fd1); } close(fd2); @@ -758,7 +759,7 @@ off_t send_files(struct file_list *flist,int f_out,int f_in) match_sums(f_out,s,buf,st.st_size); write_flush(f_out); - unmap_file(buf); + if (buf) unmap_file(buf); close(fd); free_sums(s);