aboutsummaryrefslogtreecommitdiff
path: root/convert.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-22 11:17:13 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-22 09:18:03 -0700
commit643c6f576cb7b0a7e2345cd4f8e8d7468fefc483 (patch)
treefe1007ecd39a7ead4c4dd0352f61c9cf6b37803c /convert.c
parente5530f9c5c011125420bb6416f9ba519082e98b6 (diff)
downloadgit-643c6f576cb7b0a7e2345cd4f8e8d7468fefc483.tar.xz
convert: fix leaks when resetting attributes
When resetting parsed gitattributes, we free the list of convert drivers parsed from the config. We only free some of the drivers' fields though and thus have memory leaks. Fix this by freeing all allocated convert driver fields to plug these memory leaks. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'convert.c')
-rw-r--r--convert.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/convert.c b/convert.c
index e6184d21f2..c9a31eb4f0 100644
--- a/convert.c
+++ b/convert.c
@@ -1371,6 +1371,9 @@ void reset_parsed_attributes(void)
for (drv = user_convert; drv; drv = next) {
next = drv->next;
free((void *)drv->name);
+ free((void *)drv->smudge);
+ free((void *)drv->clean);
+ free((void *)drv->process);
free(drv);
}
user_convert = NULL;