diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-03-23 07:25:21 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-03-23 07:25:21 +0000 |
commit | 2d0bb8eb0fb3d11445ab2a9657130145eaa8383e (patch) | |
tree | 2412f7581fc6f5ea287480c48bcaa43e79085785 /flist.c | |
parent | e7ebc36c70b27d9354dae6a1bc6d7ec1aefa6e6f (diff) | |
download | rsync-2d0bb8eb0fb3d11445ab2a9657130145eaa8383e.tar.gz |
save some more memory by only allocating the checksum when needed
Diffstat (limited to 'flist.c')
-rw-r--r-- | flist.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -302,8 +302,11 @@ void receive_file_entry(struct file_struct **fptr, } #endif - if (always_checksum) - read_buf(f,file->sum,csum_length); + if (always_checksum) { + file->sum = (char *)malloc(MD4_SUM_LENGTH); + if (!file->sum) out_of_memory("md4 sum"); + read_buf(f,file->sum,csum_length); + } last_mode = file->mode; last_rdev = file->rdev; @@ -395,6 +398,8 @@ static struct file_struct *make_file(char *fname) #endif if (always_checksum && S_ISREG(st.st_mode)) { + file->sum = (char *)malloc(MD4_SUM_LENGTH); + if (!file->sum) out_of_memory("md4 sum"); file_checksum(fname,file->sum,st.st_size); } |