git.samba.org
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7ebc36
)
save some more memory by only allocating the checksum when needed
author
Andrew Tridgell
<tridge@samba.org>
Mon, 23 Mar 1998 07:25:21 +0000
(07:25 +0000)
committer
Andrew Tridgell
<tridge@samba.org>
Mon, 23 Mar 1998 07:25:21 +0000
(07:25 +0000)
flist.c
patch
|
blob
|
history
rsync.h
patch
|
blob
|
history
diff --git
a/flist.c
b/flist.c
index d9f8e440288e53c87f7e30f64c0c1039a88e92f5..8226b21a1b20873089e620f142cf8058f19a0e04 100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-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);
}
diff --git
a/rsync.h
b/rsync.h
index 2ee5e03f34d1a9944bbad9324ea524294afcd5b9..d8c0d68a323aa033ecb652839587a578a4dd8dc5 100644
(file)
--- a/
rsync.h
+++ b/
rsync.h
@@
-223,7
+223,7
@@
struct file_struct {
char *dirname;
char *basedir;
char *link;
- char
sum[MD4_SUM_LENGTH]
;
+ char
*sum
;
};
struct file_list {