diff --git a/nano-8.1-fix-leak-after-linter-failure.patch b/nano-8.1-fix-leak-after-linter-failure.patch new file mode 100644 index 0000000..51279ef --- /dev/null +++ b/nano-8.1-fix-leak-after-linter-failure.patch @@ -0,0 +1,35 @@ +From 7fd38e88c12133859f48ca3191fe341795401982 Mon Sep 17 00:00:00 2001 +From: Lukáš Zaoral +Date: Tue, 10 Dec 2024 10:01:07 +0100 +Subject: 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. +--- + src/text.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/text.c b/src/text.c +index e924e818..5ac9d4ca 100644 +--- 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; + } + +-- +cgit v1.2.3-70-g09d2 + diff --git a/nano.spec b/nano.spec index 9905002..65b25cf 100644 --- a/nano.spec +++ b/nano.spec @@ -1,7 +1,7 @@ Summary: A small text editor Name: nano Version: 8.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-3.0-or-later URL: https://www.nano-editor.org @@ -14,6 +14,9 @@ Source2: bensberg.pgp # Additional sources Source3: nanorc +# avoid a leak when linter aborts after producing parsable output (RHEL-36769) +Patch0: nano-8.1-fix-leak-after-linter-failure.patch + BuildRequires: file-devel BuildRequires: gettext-devel BuildRequires: gcc @@ -78,6 +81,9 @@ rm -rf %{buildroot}%{_datadir}/nano/extra %{_datadir}/nano %changelog +* Wed Dec 11 2024 Lukáš Zaoral - 8.1-3 +- avoid a leak when linter aborts after producing parsable output (RHEL-36769) + * Tue Oct 29 2024 Troy Dawson - 8.1-2 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018