diff options
| author | Rubén Justo <rjusto@gmail.com> | 2023-06-11 20:49:28 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-06-12 15:04:16 -0700 |
| commit | 003c1f1171f12678fe7994b3e6b3f6b2f2b88de3 (patch) | |
| tree | fd335dc8d73d0f86e025856bb4e1a9aa421a5949 /notes-utils.c | |
| parent | Git 2.41 (diff) | |
| download | git-003c1f1171f12678fe7994b3e6b3f6b2f2b88de3.tar.gz git-003c1f1171f12678fe7994b3e6b3f6b2f2b88de3.zip | |
config: fix a leak in git_config_copy_or_rename_section_in_file
In 52d59cc645 (branch: add a --copy (-c) option to go with --move (-m),
2017-06-18) a new strbuf variable was introduced, but not released.
Thus, when copying a branch that has any configuration, we have a
leak.
$ git branch foo
$ git config branch.foo.some-key some_value
$ git branch -c foo bar
Direct leak of 65 byte(s) in 1 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 that leak.
Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'notes-utils.c')
0 files changed, 0 insertions, 0 deletions
