Use new0() function instead of new() followed by memset().
[rsync.git] / fileio.c
index d97cdac72a4892725e162b52cfccdd469e2f2461..bf640e207e85bff37757b2e304e320f1c544b64b 100644 (file)
--- a/fileio.c
+++ b/fileio.c
@@ -159,13 +159,12 @@ struct map_struct *map_file(int fd, OFF_T len, int32 read_size,
 {
        struct map_struct *map;
 
-       if (!(map = new(struct map_struct)))
+       if (!(map = new0(struct map_struct)))
                out_of_memory("map_file");
 
        if (blk_size && (read_size % blk_size))
                read_size += blk_size - (read_size % blk_size);
 
-       memset(map, 0, sizeof map[0]);
        map->fd = fd;
        map->file_size = len;
        map->def_window_size = read_size;