Skip to content

more small leak fixes

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6submodule--helper: use strbuf_release() to free strbufsbuiltin/submodule--helper.c+2 -20 replies
2/6checkout: fix leak of non-existent branch namesbuiltin/checkout.c+3 -10 replies
3/6config: fix leaks from git_config_get_string_const()builtin/fetch.c builtin/submodule--helper.c config.c +7 more+53 -130 replies
4/6config: drop git_config_get_string_const()Documentation/MyFirstContribution.txt apply.c cache.h +4 more+11 -233 replies
5/6config: fix leak in git_config_get_expiry_in_days()config.c+2 -20 replies
6/6submodule--helper: fix leak of core.worktree valuebuiltin/submodule--helper.c+2 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] more small leak fixes

Based on the discussion over in [1], I wondered how close we were to being able to run some test scripts with a leak-checker like LSan not complaining. The answer is...not close.

I picked t5526 more or less at random (it was the first failure when I did a parallel "make test") to see what it would take to get it passing. After much effort...I have t5526.1, the setup test, running clean. :)

There were quite a few false positives, but it did actually uncover some legitimate leaks. This series fixes those. I did it independently of the leak-fix in [2], but it would be fine to just lump it all together as one topic.

[1] https://lore.kernel.org/git/[email protected]/
[2] https://lore.kernel.org/git/[email protected]/

The patches are:

[1/6]: submodule--helper: use strbuf_release() to free strbufs [2/6]: checkout: fix leak of non-existent branch names [3/6]: config: fix leaks from git_config_get_string_const() [4/6]: config: drop git_config_get_string_const() [5/6]: config: fix leak in git_config_get_expiry_in_days() [6/6]: submodule--helper: fix leak of core.worktree value

 Documentation/MyFirstContribution.txt |  4 +--
 apply.c                               |  4 +--
 builtin/checkout.c                    |  4 ++-
 builtin/fetch.c                       |  2 +-
 builtin/submodule--helper.c           | 16 +++++------
 cache.h                               |  4 +--
 checkout.c                            |  3 +--
 config.c                              | 39 ++++++++++++++++++++++-----
 config.h                              | 12 ++++++---
 connect.c                             |  4 +--
 editor.c                              |  2 +-
 environment.c                         |  4 +--
 help.c                                |  2 +-
 protocol.c                            |  2 +-
 submodule.c                           |  4 +--
 t/helper/test-config.c                |  2 +-
 16 files changed, 69 insertions(+), 39 deletions(-)

-Peff