From: Jeff King Date: Tue, 23 Oct 2012 19:36:12 +0000 (-0400) Subject: git-config: remove memory leak of key regexp X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=35998c89381a56b28433852386986aafde92428d;p=git.git 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 --- diff --git a/builtin/config.c b/builtin/config.c index e1c33e069..e660d4830 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);