From 0f74b0ab0a3b96d87da04d9c778142ecfb370a1d Mon Sep 17 00:00:00 2001 From: DeltaMikeCharlie <127641886+DeltaMikeCharlie@users.noreply.github.com> Date: Wed, 4 Jun 2025 07:21:08 +1000 Subject: [PATCH] Coverity CID 552897 --- src/epggrab.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/epggrab.c b/src/epggrab.c index 20a1edddb..2ce352f04 100644 --- a/src/epggrab.c +++ b/src/epggrab.c @@ -516,17 +516,21 @@ time_t epggrab_get_next_int(void) { time_t ret_time; struct timespec current_time; - + clock_gettime(CLOCK_REALTIME, ¤t_time); - if(!cron_multi_next(epggrab_cron_multi, current_time.tv_sec, &ret_time)) - { - return ret_time; - } - else + + tvh_mutex_lock(&epggrab_mutex); + + if(cron_multi_next(epggrab_cron_multi, current_time.tv_sec, &ret_time)) //Zero means success { - return 0; + ret_time = 0; //Reset to zero in case it was set to garbage during failure. } -} + + tvh_mutex_unlock(&epggrab_mutex); + + return ret_time; + +}//END function /* ************************************************************************** * Count the number of EPG grabbers of a specified type -- 2.47.3