]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sched: don't allow SCH_RemoveTimeout() with invalid non-zero ID
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 10 Nov 2015 13:29:52 +0000 (14:29 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 16 Nov 2015 09:26:14 +0000 (10:26 +0100)
sched.c

diff --git a/sched.c b/sched.c
index c21f40de2be8529089617b89b5d654877236ce7d..f9720c07d31b7ba22e28661c659f5e27089fa0de 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -459,9 +459,12 @@ SCH_RemoveTimeout(SCH_TimeoutID id)
       /* Release memory back to the operating system */
       release_tqe(ptr);
 
-      break;
+      return;
     }
   }
+
+  /* Catch calls with invalid non-zero ID */
+  assert(0);
 }
 
 /* ================================================== */