screensaver.cpp and webtv_setup fix scandir memleak

This commit is contained in:
Jacek Jendrzej
2020-01-03 16:52:29 +01:00
parent 445bb5e600
commit 106c34f5dc
2 changed files with 9 additions and 1 deletions

View File

@@ -197,8 +197,14 @@ bool CScreenSaver::ReadDir()
{
struct dirent **coverlist;
int n = scandir(COVERDIR_TMP, &coverlist, 0, alphasort);
if (n > 2) // we always have the "." and ".." entrys
if (n > 2){ // we always have the "." and ".." entrys
show_audiocover = true;
for (int i = 0; i < n; i++)
{
free(coverlist[i]);
}
free(coverlist);
}
}
}