summaryrefslogtreecommitdiff
path: root/builtin/rebase.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-12-14 15:55:46 +0900
committerJunio C Hamano <gitster@pobox.com>2022-12-14 15:55:46 +0900
commit9ea1378d046d764642718f1b070689072bde4601 (patch)
treeb15bce1d35006e79f91cc2a985e7b69a77e0fd3d /builtin/rebase.c
parent7576e512cec7630ba2a35af33fa00868cedb8e18 (diff)
parentac95f5d36adb42980064587fd7910fa275ff853e (diff)
downloadgit-9ea1378d046d764642718f1b070689072bde4601.tar.gz
Merge branch 'ab/various-leak-fixes'
Various leak fixes. * ab/various-leak-fixes: built-ins: use free() not UNLEAK() if trivial, rm dead code revert: fix parse_options_concat() leak cherry-pick: free "struct replay_opts" members rebase: don't leak on "--abort" connected.c: free the "struct packed_git" sequencer.c: fix "opts->strategy" leak in read_strategy_opts() ls-files: fix a --with-tree memory leak revision API: call graph_clear() in release_revisions() unpack-file: fix ancient leak in create_temp_file() built-ins & libs & helpers: add/move destructors, fix leaks dir.c: free "ident" and "exclude_per_dir" in "struct untracked_cache" read-cache.c: clear and free "sparse_checkout_patterns" commit: discard partial cache before (re-)reading it {reset,merge}: call discard_index() before returning tests: mark tests as passing with SANITIZE=leak
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r--builtin/rebase.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index b22768ca5b..1481c5b6a5 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1322,6 +1322,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (reset_head(the_repository, &ropts) < 0)
die(_("could not move back to %s"),
oid_to_hex(&options.orig_head->object.oid));
+ strbuf_release(&head_msg);
remove_branch_state(the_repository, 0);
ret = finish_rebase(&options);
goto cleanup;
@@ -1828,10 +1829,13 @@ cleanup:
strbuf_release(&revisions);
free(options.reflog_action);
free(options.head_name);
+ strvec_clear(&options.git_am_opts);
free(options.gpg_sign_opt);
free(options.cmd);
free(options.strategy);
strbuf_release(&options.git_format_patch_opt);
free(squash_onto_name);
+ string_list_clear(&exec, 0);
+ string_list_clear(&strategy_options, 0);
return !!ret;
}