diff options
author | Taylor Blau <me@ttaylorr.com> | 2023-04-18 22:40:32 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-18 23:56:47 +0200 |
commit | c41258359e2f77a4fba000b2bbb975ebaf7d641b (patch) | |
tree | b42af0fd14f33a60475b607988119656c3672e04 /builtin | |
parent | The ninth batch (diff) | |
download | git-c41258359e2f77a4fba000b2bbb975ebaf7d641b.tar.xz git-c41258359e2f77a4fba000b2bbb975ebaf7d641b.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 ".mtimes" file.
The name is generated in `write_mtimes_file()` and the result is
returned back to `stage_tmp_packfiles()` which uses it to rename the
temporary file into place via `rename_tmp_packfiles()`.
`write_mtimes_file()` returns a `const char *`, indicating that callers
are not expected to free its result (similar to, e.g., `oid_to_hex()`).
But callers are expected to free its result, so this return type is
incorrect.
Change the function's signature to return a non-const `char *`, and free
it at the end of `stage_tmp_packfiles()`.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
0 files changed, 0 insertions, 0 deletions