summaryrefslogtreecommitdiff
path: root/builtin/config.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-10-23 19:36:12 (GMT)
committerJeff King <peff@peff.net>2012-10-24 07:36:53 (GMT)
commit35998c89381a56b28433852386986aafde92428d (patch)
tree03b880a1544faa865e972d9ae5c2b905c979abfc /builtin/config.c
parentcb20b69166786210bcad406c192763f90be1639a (diff)
downloadgit-35998c89381a56b28433852386986aafde92428d.zip
git-35998c89381a56b28433852386986aafde92428d.tar.gz
git-35998c89381a56b28433852386986aafde92428d.tar.bz2
git-config: remove memory leak of key regexp
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>
Diffstat (limited to 'builtin/config.c')
-rw-r--r--builtin/config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/config.c b/builtin/config.c
index e1c33e0..e660d48 100644
--- 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);