diff options
author | René Scharfe <l.s.r@web.de> | 2022-12-02 01:53:17 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-12-02 02:25:30 +0300 |
commit | 189e97bc4ba8d5f2ab4746d41204feed159fbe9a (patch) | |
tree | 21ac76b1ea677686d215abcc3f17bcd58455ad92 /diff.h | |
parent | 6c6048fa7f1cf7b9ae79beb0f57fd03dd4021bb4 (diff) |
diff: remove parseopts member from struct diff_options
repo_diff_setup() builds the struct option array with git diff's command
line options and stores a pointer to it in the parseopts member of
struct diff_options. The array is freed by diff_setup_done(), but not
by release_revisions(). Thus calling only repo_diff_setup() and
release_revisions() leaks that array.
We could free it in release_revisions() as well to plug that leak, but
there is a better way: Only build it when needed. Absorb
prep_parse_options() into the last place that uses the parseopts member
of struct diff_options, add_diff_parseopts(), and get rid of said
member.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.h')
-rw-r--r-- | diff.h | 1 |
1 files changed, 0 insertions, 1 deletions
@@ -394,7 +394,6 @@ struct diff_options { unsigned color_moved_ws_handling; struct repository *repo; - struct option *parseopts; struct strmap *additional_path_headers; int no_free; |