summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-11-08 19:17:48 +0100
committerTaylor Blau <me@ttaylorr.com>2022-11-08 15:50:55 -0500
commit2454e48fe312561a35ccefa24810413501ed8228 (patch)
tree842dbc732dee332911847b83a3d1cef7d07ac137 /builtin/commit.c
parent4b01badfac97cf48907e8d4d13f0d1476fa829e7 (diff)
downloadgit-2454e48fe312561a35ccefa24810413501ed8228.tar.gz
rebase: don't leak on "--abort"
Fix a leak in the recent 6159e7add49 (rebase --abort: improve reflog message, 2022-10-12). Before that commit we'd strbuf_release() the reflog message we were formatting, but when that code was refactored to use "ropts.head_msg" the strbuf_release() was omitted. Ideally the three users of "ropts" in cmd_rebase() should use different "ropts" variables, in practice they're completely separate, as this and the other user in the "switch" statement will "goto cleanup", which won't touch "ropts". The third caller after the "switch" is then unreachable if we take these two branches, so all of them are getting a "{ 0 }" init'd "ropts". So it's OK that we're leaving a stale pointer in "ropts.head_msg", cleaning it up was our responsibility, and it won't be used again. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions