]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/leakfixes-part-7'
authorJunio C Hamano <gitster@pobox.com>
Wed, 2 Oct 2024 14:46:25 +0000 (07:46 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Oct 2024 14:46:26 +0000 (07:46 -0700)
More leak-fixes.

* ps/leakfixes-part-7: (23 commits)
  diffcore-break: fix leaking filespecs when merging broken pairs
  revision: fix leaking parents when simplifying commits
  builtin/maintenance: fix leak in `get_schedule_cmd()`
  builtin/maintenance: fix leaking config string
  promisor-remote: fix leaking partial clone filter
  grep: fix leaking grep pattern
  submodule: fix leaking submodule ODB paths
  trace2: destroy context stored in thread-local storage
  builtin/difftool: plug several trivial memory leaks
  builtin/repack: fix leaking configuration
  diffcore-order: fix leaking buffer when parsing orderfiles
  parse-options: free previous value of `OPTION_FILENAME`
  diff: fix leaking orderfile option
  builtin/pull: fix leaking "ff" option
  dir: fix off by one errors for ignored and untracked entries
  builtin/submodule--helper: fix leaking remote ref on errors
  t/helper: fix leaking subrepo in nested submodule config helper
  builtin/submodule--helper: fix leaking error buffer
  builtin/submodule--helper: clear child process when not running it
  submodule: fix leaking update strategy
  ...

13 files changed:
1  2 
builtin/difftool.c
builtin/gc.c
builtin/help.c
builtin/pull.c
builtin/repack.c
builtin/submodule--helper.c
diff.c
diff.h
dir.c
git.c
submodule.c
t/t4204-patch-id.sh
t/t7900-maintenance.sh

Simple merge
diff --cc builtin/gc.c
index 7da6d1966b1b509a98022fd29af3865a5b1da353,b68a0be62c1b4f0890b950c8d5674d3c11354cfa..6a7a2da006eeee8646f20d89b8c2f352679c5372
@@@ -2169,10 -2137,10 +2177,10 @@@ static int schtasks_schedule_task(cons
        struct strbuf tfilename = STRBUF_INIT;
        int minute = get_random_minute();
  
-       get_schedule_cmd(&cmd, NULL);
+       get_schedule_cmd("schtasks", NULL, &cmd);
  
        strbuf_addf(&tfilename, "%s/schedule_%s_XXXXXX",
 -                  get_git_common_dir(), frequency);
 +                  repo_get_common_dir(the_repository), frequency);
        tfile = xmks_tempfile(tfilename.buf);
        strbuf_release(&tfilename);
  
diff --cc builtin/help.c
Simple merge
diff --cc builtin/pull.c
Simple merge
Simple merge
Simple merge
diff --cc diff.c
Simple merge
diff --cc diff.h
Simple merge
diff --cc dir.c
Simple merge
diff --cc git.c
index 2fbea24ec921e02cf71e63b27e3cf0e023eb8602,3c7fabfda262bdb29f595df6ecdc944d66f4efa9..2a9752c91c58dae2f90e3ad0a05c3517b2712b96
--- 1/git.c
--- 2/git.c
+++ b/git.c
@@@ -735,9 -745,15 +745,15 @@@ static void handle_builtin(int argc, co
        }
  
        builtin = get_builtin(cmd);
-       if (builtin)
-               exit(run_builtin(builtin, argc, argv, the_repository));
+       if (builtin) {
 -              int ret = run_builtin(builtin, argc, argv);
++              int ret = run_builtin(builtin, argc, argv, the_repository);
+               strvec_clear(&args);
+               free(argv_copy);
+               exit(ret);
+       }
        strvec_clear(&args);
+       free(argv_copy);
  }
  
  static void execv_dashed_external(const char **argv)
diff --cc submodule.c
Simple merge
Simple merge
Simple merge