git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] diff: build parseopts array on demand
@ 2022-11-30 18:01 René Scharfe
  2022-11-30 18:03 ` [PATCH 1/3] diff: factor out add_diff_options() René Scharfe
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: René Scharfe @ 2022-11-30 18:01 UTC (permalink / raw)
  To: Git List
  Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason, Jeff King

Calling repo_init_revisions() and release_revisions() in that order
leaks the memory allocated for the parseopts array in the embedded
struct diff_options member.  Get rid of that leak by reducing the
lifetime of that array.

Original patch:
https://lore.kernel.org/git/4fd82dc6-e0f8-0638-5b10-16bfef39a171@web.de/

Submitted separately from that thread because it's independent enough.

  diff: factor out add_diff_options()
  diff: let prep_parse_options() return parseopt array
  diff: remove parseopts member of struct diff_options

 builtin/range-diff.c |  2 +-
 diff-no-index.c      |  3 +--
 diff.c               | 26 +++++++++++++++-----------
 diff.h               |  1 +
 4 files changed, 18 insertions(+), 14 deletions(-)

--
2.38.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2022-12-01 23:04 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-30 18:01 [PATCH 0/3] diff: build parseopts array on demand René Scharfe
2022-11-30 18:03 ` [PATCH 1/3] diff: factor out add_diff_options() René Scharfe
2022-12-01 14:11   ` ZheNing Hu
2022-11-30 18:04 ` [PATCH 2/3] diff: let prep_parse_options() return parseopt array René Scharfe
2022-11-30 18:04 ` [PATCH 3/3] diff: remove parseopts member of struct diff_options René Scharfe
2022-12-01  1:25   ` Junio C Hamano
2022-12-01  7:52     ` René Scharfe
2022-12-01 21:56       ` Junio C Hamano
2022-12-01 22:45         ` René Scharfe
2022-12-01  1:02 ` [PATCH 0/3] diff: build parseopts array on demand Junio C Hamano
2022-12-01 13:39 ` [PATCH v2 " René Scharfe
2022-12-01 13:42   ` [PATCH v2 1/3] diff: factor out add_diff_options() René Scharfe
2022-12-01 13:43   ` [PATCH v2 2/3] diff: let prep_parse_options() return parseopt array René Scharfe
2022-12-01 13:44   ` [PATCH v2 3/3] diff: remove parseopts member from struct diff_options René Scharfe
2022-12-01 16:54   ` [PATCH v2 0/3] diff: build parseopts array on demand Ævar Arnfjörð Bjarmason
2022-12-01 19:01     ` René Scharfe
2022-12-01 19:19       ` Eric Sunshine
2022-12-01 19:43         ` René Scharfe
2022-12-01 23:00       ` Ævar Arnfjörð Bjarmason
2022-12-01 22:45 ` [PATCH v3 " René Scharfe
2022-12-01 22:49   ` [PATCH v3 1/3] diff: factor out add_diff_options() René Scharfe
2022-12-01 22:51   ` [PATCH v3 2/3] diff: use add_diff_options() in diff_opt_parse() René Scharfe
2022-12-01 22:53   ` [PATCH v3 3/3] diff: remove parseopts member from struct diff_options René Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).