Skip to content

Commit 0f74b0a

Browse files
DeltaMikeCharlieFlole998
authored andcommitted
Coverity CID 552897
1 parent 8536092 commit 0f74b0a

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

src/epggrab.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -516,17 +516,21 @@ time_t epggrab_get_next_int(void)
516516
{
517517
time_t ret_time;
518518
struct timespec current_time;
519-
519+
520520
clock_gettime(CLOCK_REALTIME, &current_time);
521-
if(!cron_multi_next(epggrab_cron_multi, current_time.tv_sec, &ret_time))
522-
{
523-
return ret_time;
524-
}
525-
else
521+
522+
tvh_mutex_lock(&epggrab_mutex);
523+
524+
if(cron_multi_next(epggrab_cron_multi, current_time.tv_sec, &ret_time)) //Zero means success
526525
{
527-
return 0;
526+
ret_time = 0; //Reset to zero in case it was set to garbage during failure.
528527
}
529-
}
528+
529+
tvh_mutex_unlock(&epggrab_mutex);
530+
531+
return ret_time;
532+
533+
}//END function
530534

531535
/* **************************************************************************
532536
* Count the number of EPG grabbers of a specified type

0 commit comments

Comments
 (0)