Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Justo <rjusto@gmail.com>2023-06-17 09:41:40 +0300
committerJunio C Hamano <gitster@pobox.com>2023-06-17 19:02:48 +0300
commit5e786ed3ee109f166b05916f3f5410f76164f8db (patch)
treef052d9e9b29db4fa0d63a47edde431a2b56e4aca /t/t1514-rev-parse-push.sh
parent2935a9783604fec3c7735a791323574354b4b75f (diff)
config: fix a leak in git_config_copy_or_rename_section_in_file
A branch can have its configuration spread over several configuration sections. This situation was already foreseen in 52d59cc645 (branch: add a --copy (-c) option to go with --move (-m), 2017-06-18) when "branch -c" was introduced. Unfortunately, a leak was also introduced: $ git branch foo $ cat >> .git/config <<EOF [branch "foo"] some-key-a = a value [branch "foo"] some-key-b = b value [branch "foo"] some-key-c = c value EOF $ git branch -c foo bar Direct leak of 130 byte(s) in 2 object(s) allocated from: ... in xrealloc wrapper.c ... in strbuf_grow strbuf.c ... in strbuf_vaddf strbuf.c ... in strbuf_addf strbuf.c ... in store_create_section config.c ... in git_config_copy_or_rename_section_in_file config.c ... in git_config_copy_section_in_file config.c ... in git_config_copy_section config.c ... in copy_or_rename_branch builtin/branch.c ... in cmd_branch builtin/branch.c ... in run_builtin git.c Let's fix it. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1514-rev-parse-push.sh')
0 files changed, 0 insertions, 0 deletions