aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-05 12:09:23 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-05 08:49:12 -0700
commit860b6780163ade3bb705d6565619ec13efcc77c6 (patch)
treee0dd948ebe83aff428f88331062d3c449b448e5b /builtin
parenta46f231975f4c7ac94af0847f4b3bb8b11493d80 (diff)
downloadgit-860b6780163ade3bb705d6565619ec13efcc77c6.tar.gz
builtin/repack: fix leaking line buffer when packing promisors
In `repack_promisor_objects()` we read output from git-pack-objects(1) line by line, using `strbuf_getline_lf()`. We never free the line buffer, causing a memory leak. Plug it. This leak is being hit in t5616, but plugging it alone is not sufficient to make the whole test suite leak free. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/repack.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/repack.c b/builtin/repack.c
index 62cfa50c50..2b9bf0318a 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -425,9 +425,11 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
free(promisor_name);
}
+
fclose(out);
if (finish_command(&cmd))
die(_("could not finish pack-objects to repack promisor objects"));
+ strbuf_release(&line);
}
struct pack_geometry {