summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-18 14:40:15 -0700
committerJunio C Hamano <gitster@pobox.com>2016-05-18 14:40:15 -0700
commit66106691a1b71e445fe5e4d6b8b043dffc7dfe4c (patch)
tree580fee1afc5f1b54fa2525fe461630a0f6b10c1b /builtin
parent989cbd455619e1e7b6156366ee7fd5376af683b6 (diff)
parent99dab16863c2eca584a84bdde748b9c113717603 (diff)
downloadgit-66106691a1b71e445fe5e4d6b8b043dffc7dfe4c.tar.gz
Merge branch 'sb/misc-cleanups' into HEAD
* sb/misc-cleanups: submodule-config: don't shadow `cache` config.c: drop local variable credential-cache, send_request: close fd when done bundle: don't leak an fd in case of early return abbrev_sha1_in_line: don't leak memory notes: don't leak memory in git_config_get_notes_strategy
Diffstat (limited to 'builtin')
-rw-r--r--builtin/notes.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index ed6f2222f4..6fd058de92 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -744,13 +744,14 @@ static int merge_commit(struct notes_merge_options *o)
static int git_config_get_notes_strategy(const char *key,
enum notes_merge_strategy *strategy)
{
- const char *value;
+ char *value;
- if (git_config_get_string_const(key, &value))
+ if (git_config_get_string(key, &value))
return 1;
if (parse_notes_merge_strategy(value, strategy))
git_die_config(key, "unknown notes merge strategy %s", value);
+ free(value);
return 0;
}