Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some systems, notably Sunos4, do not support realloc(NULL, n), so if
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
2e0e787
..
cdf0922
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-301,7
+301,10
@@
static void flist_expand(struct file_list *flist)
new_bytes = sizeof(flist->files[0]) * flist->malloced;
new_bytes = sizeof(flist->files[0]) * flist->malloced;
- new_ptr = realloc(flist->files, new_bytes);
+ if (flist->files)
+ new_ptr = realloc(flist->files, new_bytes);
+ else
+ new_ptr = malloc(new_bytes);
if (verbose >= 2) {
rprintf(FINFO, "expand file_list to %.0f bytes, did%s move\n",
if (verbose >= 2) {
rprintf(FINFO, "expand file_list to %.0f bytes, did%s move\n",