commit 7fd38e88c12133859f48ca3191fe341795401982
parent ee66c13487751416316ad54bfb486f76ef946cd3
Author: Lukáš Zaoral <lzaoral@redhat.com>
Date: Tue, 10 Dec 2024 10:01:07 +0100
memory: avoid a leak when linter aborts after producing parsable output
Any collected messages should be freed also after an
abnormal exit of the linter.
Buglet existed since version 2.4.1, commit f225991b.
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -2755,6 +2755,13 @@ void do_linter(void)
if (!WIFEXITED(lint_status) || WEXITSTATUS(lint_status) > 2) {
statusline(ALERT, _("Error invoking '%s'"), openfile->syntax->linter);
+ for (curlint = lints; curlint != NULL;) {
+ tmplint = curlint;
+ curlint = curlint->next;
+ free(tmplint->msg);
+ free(tmplint->filename);
+ free(tmplint);
+ }
return;
}