28 lines
871 B
Diff
28 lines
871 B
Diff
|
|
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
|
||
|
|
|