mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
audioplayer.cpp fix scandir memleak
This commit is contained in:
@@ -2918,10 +2918,11 @@ void CAudioPlayerGui::cleanupCovers()
|
|||||||
while (n--)
|
while (n--)
|
||||||
{
|
{
|
||||||
const char *coverfile = coverlist[n]->d_name;
|
const char *coverfile = coverlist[n]->d_name;
|
||||||
if (strcmp(coverfile, ".") == 0 || strcmp(coverfile, "..") == 0)
|
if (strcmp(coverfile, ".") != 0 && strcmp(coverfile, "..") != 0)
|
||||||
continue;
|
{
|
||||||
printf("[audioplayer] removing cover %s/%s\n", COVERDIR_TMP, coverfile);
|
printf("[audioplayer] removing cover %s/%s\n", COVERDIR_TMP, coverfile);
|
||||||
unlink(((std::string)COVERDIR_TMP + "/" + coverfile).c_str());
|
unlink(((std::string)COVERDIR_TMP + "/" + coverfile).c_str());
|
||||||
|
}
|
||||||
free(coverlist[n]);
|
free(coverlist[n]);
|
||||||
}
|
}
|
||||||
free(coverlist);
|
free(coverlist);
|
||||||
|
Reference in New Issue
Block a user