From 189e97bc4ba8d5f2ab4746d41204feed159fbe9a Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Thu, 1 Dec 2022 23:53:17 +0100 Subject: diff: remove parseopts member from struct diff_options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- diff.h | 1 - 1 file changed, 1 deletion(-) (limited to 'diff.h') diff --git a/diff.h b/diff.h index 5229f20486..6840499844 100644 --- a/diff.h +++ b/diff.h @@ -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; -- cgit v1.2.3