Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
base: 735907bde1de71e2fc90712bdb3bf30fc417a8ac
Choose a base ref
...
head repository: git/git
compare: d72d4f92e2e0fed38c6173c31e86b1b8881600e8
Choose a head ref
  • 3 commits
  • 5 files changed
  • 1 contributor

Commits on Oct 20, 2021

  1. tag: use a "goto cleanup" pattern, leak less memory

    Change cmd_tag() to free its "struct strbuf"'s instead of using an
    UNLEAK() pattern. This changes code added in 886e108 (builtin/:
    add UNLEAKs, 2017-10-01).
    
    As shown in the context of the declaration of the "struct
    msg_arg" (which I'm changing to use a designated initializer while at
    it, and to show the context in this change), that struct is just a
    thin wrapper around an int and "struct strbuf".
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Oct 20, 2021
    Copy the full SHA
    37766b6 View commit details
    Browse the repository at this point in the history
  2. ref-filter API user: add and use a ref_sorting_release()

    Add a ref_sorting_release() and use it for some of the current API
    users, the ref_sorting_default() function and its siblings will do a
    malloc() which wasn't being free'd previously.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Oct 20, 2021
    Copy the full SHA
    e5fb028 View commit details
    Browse the repository at this point in the history
  3. branch: use ref_sorting_release()

    Use a ref_sorting_release() in branch.c to free the memory from the
    ref_sorting_options(). This plugs the final in-tree memory leak of
    that API.
    
    In the preceding commit the "sorting" variable was left in the
    cmd_branch() scope, even though that wasn't needed anymore. Move it to
    the "else if (list)" scope instead. We can also move the "struct
    string_list" only used for that branch to be declared in that block
    
    That "struct ref_sorting" does not need to be "static" (and isn't
    re-used). The "ref_sorting_options()" will return a valid one, we
    don't need to make it "static" to have it zero'd out. That it was
    static was another artifact of the pre-image of the preceding commit.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Oct 20, 2021
    Copy the full SHA
    d72d4f9 View commit details
    Browse the repository at this point in the history