Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Fix a small memory leak in builtin-add
author
Benoit Sigoure
<tsuna@lrde.epita.fr>
Mon, 29 Oct 2007 07:00:33 +0000
(08:00 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 29 Oct 2007 18:39:07 +0000
(11:39 -0700)
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>
builtin-add.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
1c1f79a
)
diff --git
a/builtin-add.c
b/builtin-add.c
index 3d8b8b4f89514e0a8f7af1c2c7dc2f8ae372129e..373f87f9f296917a8d72c93307f2bb94813b6911 100644
(file)
--- 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)