summaryrefslogtreecommitdiff
path: root/builtin-add.c
diff options
context:
space:
mode:
authorBenoit Sigoure <tsuna@lrde.epita.fr>2007-10-29 07:00:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-10-29 18:39:07 (GMT)
commit399f0a8eedeec209c2eb97be6285331087234644 (patch)
tree2d9e5d8cbf5a682cee7d8b5d2293fb4143490682 /builtin-add.c
parent1c1f79a1e44547d039e7bf94d9aaadd3fae007d1 (diff)
downloadgit-399f0a8eedeec209c2eb97be6285331087234644.zip
git-399f0a8eedeec209c2eb97be6285331087234644.tar.gz
git-399f0a8eedeec209c2eb97be6285331087234644.tar.bz2
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>
Diffstat (limited to 'builtin-add.c')
-rw-r--r--builtin-add.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-add.c b/builtin-add.c
index 3d8b8b4..373f87f 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)