diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-11-05 07:17:00 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-11-04 22:37:52 -0800 |
commit | 8dd3cb4b45d06959f3344f02b2d45a4ccf8207d8 (patch) | |
tree | f41ba7c0478f6829dc00b8135b7ffedfc3a109ea /builtin/commit.c | |
parent | e29ff075e082ecdc6ee85baea83d32d4a055d186 (diff) |
diff-lib: fix leaking diffopts in `do_diff_cache()`
In `do_diff_cache()` we initialize a new `rev_info` and then overwrite
its `diffopt` with a user-provided set of options. This can leak memory
because `repo_init_revisions()` may end up allocating memory for the
`diffopt` itself depending on the configuration. And since that field is
overwritten we won't ever free it.
Plug the memory leak by releasing the diffopts before we overwrite them.
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