diff mbox series

[26/29] line-range: plug leaking find functions

Message ID ba9c2b4ea73be5e9c2529921b6491b9baaf661d5.1717402439.git.ps@pks.im (mailing list archive)
State Superseded
Headers show
Series Memory leak fixes (pt.2) | expand

Commit Message

Patrick Steinhardt June 3, 2024, 9:48 a.m. UTC
In `parse_range_funcname()` we may end up allocating a "find function",
but never free it. Fix this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 line-range.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/line-range.c b/line-range.c
index 60f0e5ada8..b99f0d9895 100644
--- a/line-range.c
+++ b/line-range.c
@@ -234,6 +234,8 @@  static const char *parse_range_funcname(
 	}
 
 	regfree(&regexp);
+	if (xecfg)
+		xdiff_clear_find_func(xecfg);
 	free(xecfg);
 	free(pattern);