summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDom Lachowicz <domlachowicz@gmail.com>2005-12-10 14:24:43 +0000
committerDom Lachowicz <domlachowicz@gmail.com>2005-12-10 14:24:43 +0000
commit5e5bd244bcd7ce40ea67b8b48e4f299dd847d801 (patch)
tree51f924606428b59693c67e24cd4da3f6f6394353
parentce0aa7c848f3a7e41ad095828dad88f5185d919a (diff)
downloadenchant-5e5bd244bcd7ce40ea67b8b48e4f299dd847d801.tar.gz
use g_getenv instead of getenv; fix bug 9801/memory leak
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@21080 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r--src/ispell/ispell_checker.cpp2
-rw-r--r--src/myspell/myspell_checker.cpp1
2 files changed, 1 insertions, 2 deletions
diff --git a/src/ispell/ispell_checker.cpp b/src/ispell/ispell_checker.cpp
index 28d4a91..57bcf91 100644
--- a/src/ispell/ispell_checker.cpp
+++ b/src/ispell/ispell_checker.cpp
@@ -397,7 +397,7 @@ s_buildHashNames (std::vector<std::string> & names, const char * dict)
#ifndef XP_TARGET_COCOA
home_dir = enchant_get_user_home_dir ();
#else
- home_dir = getenv ("HOME");
+ home_dir = g_strdup (g_getenv ("HOME"));
#endif
if (home_dir) {
private_dir = g_build_filename (home_dir, ENCHANT_ISPELL_HOME_DIR, NULL);
diff --git a/src/myspell/myspell_checker.cpp b/src/myspell/myspell_checker.cpp
index 8c6f9e4..98807c8 100644
--- a/src/myspell/myspell_checker.cpp
+++ b/src/myspell/myspell_checker.cpp
@@ -239,7 +239,6 @@ MySpellChecker::requestDictionary(const char *szLang)
{
const char *dictBase = NULL;
char *dic = NULL, *aff = NULL;
- char *home_dir = enchant_get_user_home_dir();
dic = myspell_request_dictionary (szLang);
if (!dic) {