diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-06-11 11:20:52 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-06-11 13:15:07 -0700 |
commit | 4806c55c86f7cc45f60a7ff5d757874072265deb (patch) | |
tree | 911fbcb67b1edc0e2de8a98904fc32c561e6f8ce /commit.h | |
parent | 1e5c1601f98afba0772c4548ec6befe6e97761e7 (diff) |
apply: fix leaking string in `match_fragment()`
Before calling `update_pre_post_images()`, we call `strbuf_detach()` to
put its buffer into a new string variable that we then pass to that
function. Besides being rather pointless, it also causes us to leak
memory of that variable because we never free it.
Get rid of the variable altogether and instead reach into the `strbuf`
directly. While at it, refactor the code to have a common exit path and
mark string that do not contain allocated memory as constant.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
0 files changed, 0 insertions, 0 deletions