Use new0() function instead of new() followed by memset().
[rsync/rsync.git] / exclude.c
index 96469ab..a261860 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -144,9 +144,8 @@ static void add_rule(struct filter_list_struct *listp, const char *pat,
                }
        }
 
-       if (!(ret = new(struct filter_struct)))
+       if (!(ret = new0(struct filter_struct)))
                out_of_memory("add_rule");
-       memset(ret, 0, sizeof ret[0]);
 
        if (!(mflags & (MATCHFLG_ABS_PATH | MATCHFLG_MERGE_FILE))
         && ((xflags & (XFLG_ANCHORED2ABS|XFLG_ABS_IF_SLASH) && *pat == '/')