Module: kamailio
Branch: master
Commit: 574b080d69b2b968cfe871bc7cfe8fdf930fbc2e
URL:
https://github.com/kamailio/kamailio/commit/574b080d69b2b968cfe871bc7cfe8fd…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-11-05T13:47:53+01:00
core: slow timer - warning message if callback function is null
---
Modified: src/core/timer.c
---
Diff:
https://github.com/kamailio/kamailio/commit/574b080d69b2b968cfe871bc7cfe8fd…
Patch:
https://github.com/kamailio/kamailio/commit/574b080d69b2b968cfe871bc7cfe8fd…
---
diff --git a/src/core/timer.c b/src/core/timer.c
index 1bcd036fda..f6b60ec3df 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -1101,7 +1101,19 @@ void slow_timer_main()
#endif
SET_RUNNING_SLOW(tl);
UNLOCK_SLOW_TIMER_LIST();
- ret=tl->f(*ticks, tl, tl->data);
+ if(likely(tl->f)) {
+ ret=tl->f(*ticks, tl, tl->data);
+ } else {
+ ret =0;
+#ifdef TIMER_DEBUG
+ LM_WARN("null timer callback for %p (%s:%u - %s(...))\n",
+ tl, (tl->add_file)?tl->add_file:"unknown",
+ tl->add_line,
+ (tl->add_func)?tl->add_func:"unknown");
+#else
+ LM_WARN("null callback function for %p\n", tl);
+#endif
+ }
/* reset the configuration group handles */
cfg_reset_all();
if (ret==0){