mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
gui/osdlang_setup.cpp: fix memleak - with dynamic menus locale = strdup never freed
Origin commit data
------------------
Commit: 5cb86b5857
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-05-07 (Mon, 07 May 2012)
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