summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-03-22 16:45:34 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-22 12:01:09 -0700
commit0f30ca9b3359200e660422851033a7534471f3f6 (patch)
tree97c728ac6f661effac3a8f4d29fcc25b465a19de /core
parenteb55ffde16f0f3c1df4c97c5229165acfda5637d (diff)
downloadsubsurface-0f30ca9b3359200e660422851033a7534471f3f6.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r--core/qthelper.cpp1
1 files changed, 1 insertions, 0 deletions
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)) {