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.
This commit is contained in:
Lukáš Zaoral 2024-12-10 10:01:07 +01:00 committed by Benno Schulenberg
parent ee66c13487
commit 7fd38e88c1

View File

@ -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;
}