summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDom Lachowicz <domlachowicz@gmail.com>2005-03-08 20:42:29 +0000
committerDom Lachowicz <domlachowicz@gmail.com>2005-03-08 20:42:29 +0000
commit6b0d6b0577073dbd3460e788a7cceb9c6e8f6d45 (patch)
tree03746649924ca6679de8744fe18047e87eba8af1
parente7961cfa84c6757db2736829507599bb6e9410e9 (diff)
downloadenchant-6b0d6b0577073dbd3460e788a7cceb9c6e8f6d45.tar.gz
fix potential memleak
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@21021 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r--tests/enchant-ispell.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/enchant-ispell.c b/tests/enchant-ispell.c
index d7bf1fa..5efda9e 100644
--- a/tests/enchant-ispell.c
+++ b/tests/enchant-ispell.c
@@ -256,8 +256,11 @@ parse_file (FILE * in, FILE * out, IspellMode_t mode, int countLines)
lang = g_strdup (setlocale (LC_ALL, NULL));
#endif
- if (!lang || !strcmp (lang, "C"))
+ if (!lang || !strcmp (lang, "C")) {
+ if (lang) /* lang might be "C" */
+ g_free (lang);
lang = g_strdup ("en");
+ }
/* Enchant will get rid of useless trailing garbage like de_DE@euro or de_DE.ISO-8859-15 */