-@@ -733,6 +758,9 @@ struct file_struct *make_file(char *fnam
- char thisname[MAXPATHLEN];
- char linkname[MAXPATHLEN];
- int alloc_len, basename_len, dirname_len, linkname_len, sum_len;
-+#ifdef SUPPORT_ACLS
-+ int xtra_len;
-+#endif
- char *basename, *dirname, *bp;
-
- if (!flist || !flist->count) /* Ignore lastdir when invalid. */
-@@ -848,8 +876,19 @@ struct file_struct *make_file(char *fnam
- sum_len = always_checksum && am_sender && S_ISREG(st.st_mode)
- ? MD4_SUM_LENGTH : 0;
-
-+#ifdef SUPPORT_ACLS
-+ /* We need one or two index int32s when we're preserving an ACL. */
-+ if (preserve_acls)
-+ xtra_len = (S_ISDIR(st.st_mode) ? 2 : 1) * 4;
-+ else
-+ xtra_len = 0;
-+#endif
-+
- alloc_len = file_struct_len + dirname_len + basename_len
-- + linkname_len + sum_len;
-+#ifdef SUPPORT_ACLS
-+ + xtra_len
-+#endif
-+ + linkname_len + sum_len;
- if (flist)
- bp = pool_alloc(flist->file_pool, alloc_len, "make_file");
- else {
-@@ -860,6 +899,9 @@ struct file_struct *make_file(char *fnam
- file = (struct file_struct *)bp;
- memset(bp, 0, file_struct_len);
- bp += file_struct_len;
-+#ifdef SUPPORT_ACLS
-+ bp += xtra_len;
-+#endif
-
- file->flags = flags;
- file->modtime = st.st_mtime;
-@@ -952,6 +994,9 @@ static struct file_struct *send_file_nam