Code

fast-import: leakfix for 'ls' of dirty trees
[git.git] / submodule.c
index 4e62900af1c28a37ee44514afe93f398eed591e0..6f1c10722f744f4a27f18dae4867b15ecbf57d49 100644 (file)
@@ -264,7 +264,8 @@ int fetch_populated_submodules(int num_options, const char **options,
                if (read_cache() < 0)
                        die("index file corrupt");
 
-       argv = xcalloc(num_options + 5, sizeof(const char *));
+       /* 4: "fetch" (options) "--submodule-prefix" prefix NULL */
+       argv = xcalloc(num_options + 4, sizeof(const char *));
        argv[argc++] = "fetch";
        for (i = 0; i < num_options; i++)
                argv[argc++] = options[i];