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>
This commit is contained in:
Berthold Stoeger 2020-03-22 16:45:34 +01:00 committed by Dirk Hohndel
parent eb55ffde16
commit 0f30ca9b33

View file

@ -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)) {