mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
gui/osdlang_setup.cpp: fix memleak - with dynamic menus locale = strdup never freed
This commit is contained in:
@@ -171,18 +171,14 @@ void COsdLangSetup::showLanguageSetup(CMenuWidget *osdl_setup)
|
||||
{
|
||||
for (int count=0; count<n; count++)
|
||||
{
|
||||
char * locale = strdup(namelist[count]->d_name);
|
||||
char * locale = namelist[count]->d_name;
|
||||
char * pos = strstr(locale, ".locale");
|
||||
if (pos != NULL)
|
||||
{
|
||||
char iname[50];
|
||||
*pos = '\0';
|
||||
sprintf(iname, "%s", locale);
|
||||
CMenuOptionLanguageChooser* oj = new CMenuOptionLanguageChooser((char*)locale, this, iname);
|
||||
oj->addOption(locale);
|
||||
CMenuOptionLanguageChooser* oj = new CMenuOptionLanguageChooser((char*)locale, this, locale);
|
||||
osdl_setup->addItem( oj );
|
||||
} else
|
||||
free(locale);
|
||||
}
|
||||
free(namelist[count]);
|
||||
}
|
||||
free(namelist);
|
||||
|
Reference in New Issue
Block a user