From 0f30ca9b3359200e660422851033a7534471f3f6 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 22 Mar 2020 16:45:34 +0100 Subject: cleanup: remove memory leak in initUiLocale() The prefs.locale.lang_locale field was overwritten without free()ing the old value. Not that the function would be called numerous times, but as a matter of principle... Signed-off-by: Berthold Stoeger --- core/qthelper.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'core') diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 3321a3387..7e3b58b11 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -483,6 +483,7 @@ void initUiLanguage() uiLang = languages[2]; } + free((void*)prefs.locale.lang_locale); prefs.locale.lang_locale = copy_qstring(uiLang); if (!prefs.date_format_override || empty_string(prefs.date_format_short) || empty_string(prefs.date_format)) { -- cgit v1.2.3-70-g09d2