From: Benoit Sigoure Date: Mon, 29 Oct 2007 07:00:33 +0000 (+0100) Subject: Fix a small memory leak in builtin-add X-Git-Tag: v1.5.3.5~14 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=399f0a8eedeec209c2eb97be6285331087234644;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin-add.c b/builtin-add.c index 3d8b8b4f8..373f87f9f 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -44,6 +44,7 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p die("pathspec '%s' did not match any files", pathspec[i]); } + free(seen); } static void fill_directory(struct dir_struct *dir, const char **pathspec, @@ -140,6 +141,7 @@ static void refresh(int verbose, const char **pathspec) if (!seen[i]) die("pathspec '%s' did not match any files", pathspec[i]); } + free(seen); } static int git_add_config(const char *var, const char *value)