diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-08-12 23:19:08 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-08-12 23:19:08 +0300 |
commit | 83489a5b2073cf031412a911cc7e30e6a1de27ac (patch) | |
tree | 4f836f15071141bc1e74020507d126a75e8060a0 /revision.c | |
parent | 657c7403a3c15ac670f82d0ace38bab810755e10 (diff) | |
parent | f92dbdbc6a8aa5f3979f4bb7a7b9bbc8ec9b4aa6 (diff) |
Merge branch 'ab/plug-revisions-leak'
Plug a bit more leaks in the revisions API.
* ab/plug-revisions-leak:
revisions API: don't leak memory on argv elements that need free()-ing
bisect.c: partially fix bisect_rev_setup() memory leak
log: refactor "rev.pending" code in cmd_show()
log: fix a memory leak in "git show <revision>..."
test-fast-rebase helper: use release_revisions() (again)
bisect.c: add missing "goto" for release_revisions()
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/revision.c b/revision.c index 87f1c117d1..f4eee11cc8 100644 --- a/revision.c +++ b/revision.c @@ -2784,6 +2784,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s const char *arg = argv[i]; if (strcmp(arg, "--")) continue; + if (opt && opt->free_removed_argv_elements) + free((char *)argv[i]); argv[i] = NULL; argc = i; if (argv[i + 1]) |