@matheusbsbs / matheus-bagliano / commits / 399f0a8eed
Fork 0

Fix a small memory leak in builtin-add

prune_directory and fill_directory allocated one byte per pathspec and never freed it. Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Benoit Sigoure committed Oct 29, 2007 at 08:00 UTC 399f0a8eedeec209c2eb97be6285331087234644
1 file changed +2
builtin-add.c
+2
@@ -44,6 +44,7 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p
44 die("pathspec '%s' did not match any files",
45 pathspec[i]);
46 }
47 + free(seen);
48 }
49
50 static void fill_directory(struct dir_struct *dir, const char **pathspec,
@@ -140,6 +141,7 @@ static void refresh(int verbose, const char **pathspec)
141 if (!seen[i])
142 die("pathspec '%s' did not match any files", pathspec[i]);
143 }
144 + free(seen);
145 }
146
147 static int git_add_config(const char *var, const char *value)