projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb20b69
)
git-config: remove memory leak of key regexp
author
Jeff King
<peff@peff.net>
Tue, 23 Oct 2012 19:36:12 +0000
(15:36 -0400)
committer
Jeff King
<peff@peff.net>
Wed, 24 Oct 2012 07:36:53 +0000
(
03:36
-0400)
This is only called once per invocation, so it's not a major
leak, but it's easy to fix.
Signed-off-by: Jeff King <peff@peff.net>
builtin/config.c
patch
|
blob
|
history
diff --git
a/builtin/config.c
b/builtin/config.c
index e1c33e0691796601ac869278c155194d33ee8332..e660d48300b874fe422e813dbcd5f5eecab31e56 100644
(file)
--- a/
builtin/config.c
+++ b/
builtin/config.c
@@
-248,6
+248,10
@@
static int get_value(const char *key_, const char *regex_)
git_config_from_file(fn, system_wide, data);
free(key);
+ if (key_regexp) {
+ regfree(key_regexp);
+ free(key_regexp);
+ }
if (regexp) {
regfree(regexp);
free(regexp);