!33 Fix a leak in the tests

From: @dongjiao-joan 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2024-05-10 10:42:29 +00:00 committed by Gitee
commit 82287bee9e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From baf95e6258125dc787363c9eb2e1e9f5686e399c Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
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

View File

@ -1,12 +1,13 @@
Name: enchant2 Name: enchant2
Version: 2.6.7 Version: 2.6.7
Release: 3 Release: 4
Summary: Generic spell checking library Summary: Generic spell checking library
License: LGPLv2+ License: LGPLv2+
URL: https://github.com/AbiWord/enchant URL: https://github.com/AbiWord/enchant
Source0: https://github.com/AbiWord/enchant/releases/download/v%{version}/enchant-%{version}.tar.gz Source0: https://github.com/AbiWord/enchant/releases/download/v%{version}/enchant-%{version}.tar.gz
Patch0: Add-with-hunspell-dir-parameters.patch Patch0: Add-with-hunspell-dir-parameters.patch
Patch1: Parameter-h-correction.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 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 %doc %{_defaultdocdir}/%{name}/enchant-lsmod-2.html
%changelog %changelog
* Thu May 9 2024 dongjiao <dongjiao@kylinos.cn> - 2.6.7-4
- Fix a leak in the tests
* Wed Apr 3 2024 zhangxianting <zhangxianting@uniontech.com> - 2.6.7-3 * Wed Apr 3 2024 zhangxianting <zhangxianting@uniontech.com> - 2.6.7-3
- parament -h reture value be 0 - parament -h reture value be 0