summaryrefslogtreecommitdiffstats
path: root/windows.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-02-09 21:29:56 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-09 11:38:51 -0800
commit2af818bf918a4d07aedf6cc17b5783a2c964b506 (patch)
treec175bbf17a18a8e68f6d3271fdab51bfac88467b /windows.c
parenta4ae0a46501e44c3fb04d6227d721d2036dd6609 (diff)
downloadsubsurface-2af818bf918a4d07aedf6cc17b5783a2c964b506.tar.gz
Fixed some memory leaks in windows.c and main.c
windows.c:subsurface_gettext_domainpath(): - memory at pointer returned from g_win32_getlocale() should be released main.c:setup_system_prefs() - it seems all calls to <os_file>:system_default_filename() return a pre-allocated buffer, therefore we don't need to call strdup() on the result itself. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'windows.c')
-rw-r--r--windows.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/windows.c b/windows.c
index 9087c9e4e..3db08deab 100644
--- a/windows.c
+++ b/windows.c
@@ -232,8 +232,10 @@ const char *subsurface_gettext_domainpath(char *argv0)
/* first hackishly make sure that the LANGUAGE information is correctly set up
* in the environment */
char buffer[80];
- snprintf(buffer, sizeof(buffer), "LANGUAGE=%s.UTF-8", g_win32_getlocale());
+ gchar *locale = g_win32_getlocale();
+ snprintf(buffer, sizeof(buffer), "LANGUAGE=%s.UTF-8", locale);
putenv(buffer);
+ g_free(locale);
/* always use translation directory relative to install location, regardless of argv0 */
return "./share/locale";
}