From a08438bda21b3e0d7db2db2360d040841970104d Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 19 Jun 2017 14:38:31 -0500 Subject: Import Upstream version 0.3.7pre --- intl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'intl.c') diff --git a/intl.c b/intl.c index e0817b51..82ac163f 100644 --- a/intl.c +++ b/intl.c @@ -41,7 +41,8 @@ void intl_init(void) } /* - * GNU's gettext is cool and all... but hey, this is smaller :) + * GNU's gettext is cool and all... but hey, this is smaller, + * but slower :P */ const gchar * intl_translate(const gchar * string, const gchar * source) __THROW @@ -50,7 +51,7 @@ intl_translate(const gchar * string, const gchar * source) __THROW gchar buffer[256], *keyname, *lang = NULL, *langenv = NULL; const gchar *retval, *langvars[] = {"LANG", "LC_MESSAGES", "LC_ALL", NULL}; - gboolean found; + gboolean found = FALSE; struct stat st; gint i = 0; @@ -67,6 +68,7 @@ intl_translate(const gchar * string, const gchar * source) __THROW langenv_ok: lang = g_strconcat(INTL_PREFIX, langenv, ".lang", NULL); if (stat(lang, &st)) { + g_free(lang); lang = g_strconcat(INTL_PREFIX, "default.lang", NULL); if (stat(lang, &st)) { not_found: -- cgit v1.2.3