mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
gui/plugins.cpp: fix memleak in scandir
This commit is contained in:
@@ -108,6 +108,9 @@ void CPlugins::scanDir(const char *dir)
|
||||
|
||||
int number_of_files = scandir(dir, &namelist, 0, alphasort);
|
||||
|
||||
if(number_of_files < 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < number_of_files; i++)
|
||||
{
|
||||
std::string filename;
|
||||
@@ -147,7 +150,9 @@ void CPlugins::scanDir(const char *dir)
|
||||
}
|
||||
}
|
||||
}
|
||||
free(namelist[i]);
|
||||
}
|
||||
free(namelist);
|
||||
}
|
||||
|
||||
void CPlugins::loadPlugins()
|
||||
|
Reference in New Issue
Block a user