diff mbox series

[v2,11/29] builtin/difftool: plug memory leaks in `run_dir_diff()`

Message ID e6ff9a3f1c39a1cb69e8045268577174c6a0123c.1718095906.git.ps@pks.im (mailing list archive)
State Accepted
Commit 9e903a5531f239a1ff3ab5fec2f0bb6fda595010
Headers show
Series Memory leak fixes (pt.2) | expand

Commit Message

Patrick Steinhardt June 11, 2024, 9:20 a.m. UTC
We're leaking a bunch of memory leaks in `run_dir_diff()`. Plug them.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 builtin/difftool.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/builtin/difftool.c b/builtin/difftool.c
index a1794b7eed..dcc68e190c 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -662,6 +662,9 @@  static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
 
 	free(lbase_dir);
 	free(rbase_dir);
+	strbuf_release(&info);
+	strbuf_release(&lpath);
+	strbuf_release(&rpath);
 	strbuf_release(&ldir);
 	strbuf_release(&rdir);
 	strbuf_release(&wtdir);