mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 17:31:11 +02:00
neutrino.cpp: fix possible segfault , suplement to 8c27ae6270
Origin commit data
------------------
Commit: 6ac36258d6
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-10-02 (Tue, 02 Oct 2012)
This commit is contained in:
@@ -561,15 +561,17 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
||||
if(g_settings.auto_delete) {
|
||||
if(strcmp(g_settings.timeshiftdir, g_settings.network_nfs_recordingdir)) {
|
||||
DIR *d = opendir(timeshiftDir);
|
||||
while (struct dirent *e = readdir(d))
|
||||
{
|
||||
std::string filename = e->d_name;
|
||||
if ((filename.find("_temp.ts") == filename.size() - 8) || (filename.find("_temp.xml") == filename.size() - 9))
|
||||
if(d){
|
||||
while (struct dirent *e = readdir(d))
|
||||
{
|
||||
remove(filename.c_str());
|
||||
std::string filename = e->d_name;
|
||||
if ((filename.find("_temp.ts") == filename.size() - 8) || (filename.find("_temp.xml") == filename.size() - 9))
|
||||
{
|
||||
remove(filename.c_str());
|
||||
}
|
||||
}
|
||||
closedir(d);
|
||||
}
|
||||
closedir(d);
|
||||
}
|
||||
}
|
||||
g_settings.record_hours = configfile.getInt32( "record_hours", 4 );
|
||||
|
Reference in New Issue
Block a user