Skip to content

Commit

Permalink
git-config: remove memory leak of key regexp
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King committed Oct 24, 2012
1 parent cb20b69 commit 35998c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions builtin/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 35998c8

Please sign in to comment.