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: 55b99febc40308985f319ae3feaa23070abebdb7
Choose a base ref
...
head repository: git/git
compare: 3c8150497f3c77a2c57e73c53bd3de933b85d9a3
Choose a head ref
  • 6 commits
  • 5 files changed
  • 1 contributor

Commits on Oct 23, 2021

  1. grep: prefer "struct grep_opt" over its "void *" equivalent

    Stylistically fix up code added in bfac23d (grep: Fix two memory
    leaks, 2010-01-30). We usually don't use the "arg" at all once we've
    casted it to the struct we want, let's not do that here when we're
    freeing it. Perhaps it was thought that a cast to "void *" would
    otherwise be needed?
    
    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 23, 2021
    Copy the full SHA
    a2fb767 View commit details
    Browse the repository at this point in the history
  2. grep: use object_array_clear() in cmd_grep()

    Free the "struct object_array" before exiting. This makes grep tests
    (e.g.  "t7815-grep-binary.sh") a bit happer under SANITIZE=leak.
    
    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 23, 2021
    Copy the full SHA
    96c1012 View commit details
    Browse the repository at this point in the history
  3. grep: fix a "path_list" memory leak

    Free the "path_list" used in builtin/grep.c, it was declared as
    STRING_LIST_INIT_NODUP, let's change it to a STRING_LIST_INIT_DUP
    since an early user in cmd_grep() appends a string passed via
    parse-options.c to it, which needs to be duplicated.
    
    Let's then convert the remaining callers to use
    string_list_append_nodup() instead, allowing us to free the list.
    
    This makes all the tests in t7811-grep-open.sh pass, 6/10 would fail
    before this change. The only remaining failure would have been due to
    a stray "git checkout" (which still leaks memory). In this case we can
    use a "git reset --hard" instead, so let's do that, and move the
    test_when_finished() above the code that would modify the relevant
    file.
    
    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 23, 2021
    Copy the full SHA
    b202e51 View commit details
    Browse the repository at this point in the history
  4. clone: fix a memory leak of the "git_dir" variable

    At this point in cmd_clone the "git_dir" is always either an
    xstrdup()'d string, or something we got from mkpathdup(). Let's free()
    it before we clobber it.
    
    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 23, 2021
    Copy the full SHA
    27ff1fb View commit details
    Browse the repository at this point in the history
  5. submodule--helper: fix small memory leaks

    Add a missing strbuf_release() and a clear_pathspec() to the
    submodule--helper.
    
    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 23, 2021
    Copy the full SHA
    c270b05 View commit details
    Browse the repository at this point in the history
  6. reflog: free() ref given to us by dwim_log()

    When dwim_log() returns the "ref" is always ether NULL or an
    xstrdup()'d string.
    
    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 23, 2021
    Copy the full SHA
    3c81504 View commit details
    Browse the repository at this point in the history