From 39cc637d2bd46967a0111ebc0ca6e2f42c179d8d Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 16 May 2005 23:36:13 +0000 Subject: [PATCH] Use new_array() instead of malloc(). --- link-by-hash.diff | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/link-by-hash.diff b/link-by-hash.diff index 6c1e6f3..8461fc7 100644 --- a/link-by-hash.diff +++ b/link-by-hash.diff @@ -130,7 +130,7 @@ the file's name. + if (this_fnbr > *fnbr) + *fnbr = this_fnbr; + -+ hashfile = (struct hashfile_struct*)malloc(sizeof(struct hashfile_struct)); ++ hashfile = new_array(struct hashfile_struct, 1); + asprintf(&hashfile->name,"%s/%s",hashname, + di->d_name); + if (do_stat(hashfile->name,&st) == -1) { @@ -511,7 +511,7 @@ the file's name. /* recv file data */ +#if HAVE_LINK + if (link_by_hash_dir) -+ file->u.sum = (char*)malloc(MD4_SUM_LENGTH); ++ file->u.sum = new_array(char, MD4_SUM_LENGTH); +#endif recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size, - fname, fd2, file->length); @@ -560,7 +560,7 @@ the file's name. #include "byteorder.h" #include "lib/mdfour.h" ---- orig/rsync.yo 2005-05-10 16:14:33 +--- orig/rsync.yo 2005-05-10 23:47:12 +++ rsync.yo 2005-02-13 06:58:47 @@ -356,6 +356,7 @@ to the detailed description below for a --compare-dest=DIR also compare received files relative to DIR -- 2.34.1