Fix all leaks in tests t0002-t0099: Part 2
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest12 patches 7 repliesIn review
- v112 patches 18 repliesSuperseded
Patches in v2 No applies recorded yet
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 00/12] Fix all leaks in tests t0002-t0099: Part 2
From: Andrzej Hunt <[email protected]>
V2 fixes patch 11/12 (rebase_options.strategy lifecycle) as per review discussion. Many thanks to Phillip and Elijah for spotting the issues there!
ATB,
Andrzej
Andrzej Hunt (12):
fmt-merge-msg: free newly allocated temporary strings when done
environment: move strbuf into block to plug leak builtin/submodule--helper: release unused strbuf to avoid leak builtin/for-each-repo: remove unnecessary argv copy to plug leak
diffcore-rename: move old_dir/new_dir definition to plug leak
ref-filter: also free head for ATOM_HEAD to avoid leak
read-cache: call diff_setup_done to avoid leak
convert: release strbuf to avoid leak
builtin/mv: free or UNLEAK multiple pointers at end of cmd_mv builtin/merge: free found_ref when done builtin/rebase: fix options.strategy memory lifecycle
reset: clear_unpack_trees_porcelain to plug leak
builtin/for-each-repo.c | 14 ++++---------- builtin/merge.c | 3 ++- builtin/mv.c | 5 +++++ builtin/rebase.c | 3 ++- builtin/submodule--helper.c | 6 ++++-- convert.c | 2 ++ diffcore-rename.c | 10 +++++++--- environment.c | 7 +++---- fmt-merge-msg.c | 6 ++++-- read-cache.c | 1 + ref-filter.c | 8 ++++++-- reset.c | 4 ++-- 12 files changed, 42 insertions(+), 27 deletions(-)
Interdiff against v1:
builtin/rebase.c +3 -1
@@ -1723,6 +1723,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) }if (options.strategy) { + options.strategy =xstrdup (options.strategy);switch (options.type) {case REBASE_APPLY :die (_ ("--strategy requires --merge or --interactive" ));
@@ -1775,7 +1776,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)if (options.type ==REBASE_MERGE && !options.strategy &&getenv ("GIT_TEST_MERGE_ALGORITHM" )) - options.strategy =getenv ("GIT_TEST_MERGE_ALGORITHM" ); + options.strategy =xstrdup (getenv ("GIT_TEST_MERGE_ALGORITHM" ));switch (options.type) {case REBASE_MERGE :
@@ -2108,6 +2109,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)free (options.head_name);free (options.gpg_sign_opt);free (options.cmd); +free (options.strategy);strbuf_release (&options.git_format_patch_opt);free (squash_onto_name);return ret;
Signature · 1 line
2.26.2