From b1f87a1916b90a184e325dfde152ca58432c604b Mon Sep 17 00:00:00 2001 From: dongjiao Date: Wed, 8 May 2024 10:55:48 +0800 Subject: [PATCH] Fix a leak in the tests (cherry picked from commit bec8c4ce4ed59be95ae65de2da1f652318d34ad3) --- Fix-a-leak-in-the-tests.patch | 27 +++++++++++++++++++++++++++ enchant2.spec | 6 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 Fix-a-leak-in-the-tests.patch diff --git a/Fix-a-leak-in-the-tests.patch b/Fix-a-leak-in-the-tests.patch new file mode 100644 index 0000000..d086f98 --- /dev/null +++ b/Fix-a-leak-in-the-tests.patch @@ -0,0 +1,27 @@ +From baf95e6258125dc787363c9eb2e1e9f5686e399c Mon Sep 17 00:00:00 2001 +From: Reuben Thomas +Date: Thu, 11 Apr 2024 22:48:29 +0200 +Subject: [PATCH] Fix a leak in the tests + +--- + tests/EnchantTestFixture.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/EnchantTestFixture.h b/tests/EnchantTestFixture.h +index 160256f..9909e58 100644 +--- a/tests/EnchantTestFixture.h ++++ b/tests/EnchantTestFixture.h +@@ -69,7 +69,9 @@ struct EnchantTestFixture + { + GSList *config_dirs = enchant_get_conf_dirs(); + const char *pkgdatadir = (char *)g_slist_nth(config_dirs, 0)->data; +- return std::string(pkgdatadir); ++ auto res = std::string(pkgdatadir); ++ g_slist_free_full(config_dirs, g_free); ++ return res; + } + + static void DeleteDirAndFiles(const std::string& dir) +-- +2.27.0 + diff --git a/enchant2.spec b/enchant2.spec index 429246e..bcf672c 100644 --- a/enchant2.spec +++ b/enchant2.spec @@ -1,12 +1,13 @@ Name: enchant2 Version: 2.6.7 -Release: 3 +Release: 4 Summary: Generic spell checking library License: LGPLv2+ URL: https://github.com/AbiWord/enchant Source0: https://github.com/AbiWord/enchant/releases/download/v%{version}/enchant-%{version}.tar.gz Patch0: Add-with-hunspell-dir-parameters.patch Patch1: Parameter-h-correction.patch +Patch2: Fix-a-leak-in-the-tests.patch BuildRequires: automake autoconf libtool gcc-c++ glib2-devel aspell-devel hunspell-devel libvoikko-devel @@ -99,6 +100,9 @@ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g; %doc %{_defaultdocdir}/%{name}/enchant-lsmod-2.html %changelog +* Thu May 9 2024 dongjiao - 2.6.7-4 +- Fix a leak in the tests + * Wed Apr 3 2024 zhangxianting - 2.6.7-3 - parament -h reture value be 0 -- Gitee