diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-05-27 13:46:20 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-27 11:19:59 -0700 |
commit | f9c19896749912da7add7ef855ea0543cca91bef (patch) | |
tree | ad2f5d42af38b699b68d795a91f856176c718f9d /builtin/commit.c | |
parent | 6073b3b5c37716c50244d635e7c358f41f43e286 (diff) |
diff: refactor code to clarify memory ownership of prefixes
The source and destination prefixes are tracked in a `const char *`
array, but may at times contain allocated strings. The result is that
those strings may be leaking because we never free them.
Refactor the code to always store allocated strings in those variables,
freeing them as required. This requires us to handle the default values
a bit different compared to before. But given that there is only a
single callsite where we use the variables to `struct diff_options` it's
easy to handle the defaults there.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions