Added assert in timer if entry is scheduled more than once
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@193 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjlib/src/pj/timer.c b/pjlib/src/pj/timer.c
index 8eaab79..2a791b6 100644
--- a/pjlib/src/pj/timer.c
+++ b/pjlib/src/pj/timer.c
@@ -446,6 +446,9 @@
PJ_ASSERT_RETURN(ht && entry && delay, PJ_EINVAL);
PJ_ASSERT_RETURN(entry->cb != NULL, PJ_EINVAL);
+ /* Prevent same entry from being scheduled more than once */
+ PJ_ASSERT_RETURN(entry->_timer_id < 1, PJ_EINVALIDOP);
+
pj_gettimeofday(&expires);
PJ_TIME_VAL_ADD(expires, *delay);