screensaver.cpp and webtv_setup fix scandir memleak

Origin commit data
------------------
Branch: ni/coolstream
Commit: 448e824971
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-01-04 (Sat, 04 Jan 2020)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2020-01-04 11:08:11 +01:00
committed by vanhofen
parent afb627fbc2
commit 1272c0dd5b
2 changed files with 9 additions and 1 deletions

View File

@@ -214,8 +214,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);
}
}
}