aboutsummaryrefslogtreecommitdiffstats
path: root/commit.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2023-04-12 18:20:17 -0400
committerJunio C Hamano <gitster@pobox.com>2023-04-13 07:55:45 -0700
commit3969e6c5a4accacce6c69083a70710a52a8f2255 (patch)
tree954a48276ed66bb2323bb72b9e7bd4fdca5b0b99 /commit.c
parentThe ninth batch (diff)
downloadgit-3969e6c5a4accacce6c69083a70710a52a8f2255.tar.gz
git-3969e6c5a4accacce6c69083a70710a52a8f2255.zip
pack-write.c: plug a leak in stage_tmp_packfiles()
The function `stage_tmp_packfiles()` generates a filename to use for staging the contents of what will become the pack's ".rev" file. The name is generated in `write_rev_file_order()` (via its caller `write_rev_file()`) in a string buffer, and the result is returned back to `stage_tmp_packfiles()` which uses it to rename the temporary file into place via `rename_tmp_packfiles()`. That name is not visible outside of `stage_tmp_packfiles()`, so it can (and should) be `free()`'d at the end of that function. We can't free it in `rename_tmp_packfile()` since not all of its `source` arguments are unreachable after calling it. Instead, simply free() `rev_tmp_name` at the end of `stage_tmp_packfiles()`. (Note that the same leak exists for `mtimes_tmp_name`, but we do not address it in this commit). Signed-off-by: Taylor Blau <me@ttaylorr.com> Acked-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions