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);
}
}
}

View File

@@ -375,7 +375,9 @@ void CWebTVSetup::webchannels_auto()
{
printf("[CWebTVSetup] skipping: %s\n", webchannel_file);
}
free(filelist[count]);
}
free(filelist);
}
}
}