screensaver.cpp and webtv_setup fix scandir memleak

Origin commit data
------------------
Commit: 448e824971
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-01-04 (Sat, 04 Jan 2020)
This commit is contained in:
Jacek Jendrzej
2020-01-04 11:08:11 +01:00
committed by vanhofen
parent 872ed147df
commit 8210bd73ca
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);
}
}
}

View File

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