Git 2.1.0-rc1
[gitweb.git] / builtin / clean.c
index 27701d222c78ed84691b65334a7909f90c589464..1032563e5fae880df9256c9eafaa96d60462ecd2 100644 (file)
@@ -621,8 +621,7 @@ static int *list_and_choose(struct menu_opts *opts, struct menu_stuff *stuff)
                                nr += chosen[i];
                }
 
-               result = xmalloc(sizeof(int) * (nr + 1));
-               memset(result, 0, sizeof(int) * (nr + 1));
+               result = xcalloc(nr + 1, sizeof(int));
                for (i = 0; i < stuff->nr && j < nr; i++) {
                        if (chosen[i])
                                result[j++] = i;