Here is another iteration of a series to fix some leaks in the cherry-pick, revert and sequencer code. The previous iteration only had patch 1 and 2. They haven't changed. I just added the last 5 patches. Maybe the last 2 patches are a bit overkill. But with this series, the valgrind output with --leak-check=full is much cleaner. There most important leaks are still there though. One of them is related to ce_entries, like this: ==2015== 522 bytes in 6 blocks are definitely lost in loss record 51 of 54 ==2015== at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2015== by 0x53113B: xcalloc (wrapper.c:119) ==2015== by 0x52BBE9: create_ce_entry (unpack-trees.c:559) ==2015== by 0x52BDC6: unpack_nondirectories (unpack-trees.c:609) ==2015== by 0x52C45B: unpack_callback (unpack-trees.c:799) ==2015== by 0x529B9B: traverse_trees (tree-walk.c:407) ==2015== by 0x52CE53: unpack_trees (unpack-trees.c:1091) ==2015== by 0x4D1B89: git_merge_trees (merge-recursive.c:241) ==2015== by 0x4D673A: merge_trees (merge-recursive.c:1819) ==2015== by 0x509521: do_recursive_merge (sequencer.c:225) ==2015== by 0x509F5B: do_pick_commit (sequencer.c:457) ==2015== by 0x50B3B4: pick_commits (sequencer.c:878) The other one is related to the index: ==2015== 574 (400 direct, 174 indirect) bytes in 2 blocks are definitely lost in loss record 52 of 54 ==2015== at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2015== by 0x53113B: xcalloc (wrapper.c:119) ==2015== by 0x4EF8CF: read_index_from (read-cache.c:1441) ==2015== by 0x4EF316: read_index (read-cache.c:1282) ==2015== by 0x50940B: do_recursive_merge (sequencer.c:211) ==2015== by 0x509F5B: do_pick_commit (sequencer.c:457) ==2015== by 0x50B3B4: pick_commits (sequencer.c:878) ==2015== by 0x50B7C6: sequencer_pick_revisions (sequencer.c:994) ==2015== by 0x47A6D5: cmd_cherry_pick (revert.c:237) ==2015== by 0x404FEE: run_builtin (git.c:308) ==2015== by 0x405181: handle_internal_command (git.c:468) ==2015== by 0x40529B: run_argv (git.c:514) Christian Couder (7): sequencer: fix leaked todo_list memory sequencer: release a strbuf used in save_head() merge-recursive: free some string lists revert: free opts.revs to do a bit of cleanup revert: free revs->cmdline.rev unpack-trees: record which unpack error messages should be freed Properly free unpack trees error messages builtin/checkout.c | 1 + builtin/merge.c | 6 ++++-- builtin/revert.c | 6 ++++++ merge-recursive.c | 5 ++++- sequencer.c | 16 +++++++++++++--- unpack-trees.c | 50 +++++++++++++++++++++++++++++++++++--------------- unpack-trees.h | 3 +++ 7 files changed, 66 insertions(+), 21 deletions(-) -- 1.7.10.2.555.g6528037 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html