From f7a32bb02e999e8cd6df51c36d894a5847c7030d Mon Sep 17 00:00:00 2001 From: vasiljevic Date: Tue, 4 Oct 2005 18:33:30 +0000 Subject: Tcl_DeleteTimerHandler(): bail out early if passed NULL argument. --- generic/tclTimer.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/generic/tclTimer.c b/generic/tclTimer.c index e441867..faf44b7 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTimer.c,v 1.18 2005/09/15 16:40:02 dgp Exp $ + * RCS: @(#) $Id: tclTimer.c,v 1.19 2005/10/04 18:33:30 vasiljevic Exp $ */ #include "tclInt.h" @@ -345,9 +345,12 @@ Tcl_DeleteTimerHandler(token) * Tcl_DeleteTimerHandler. */ { register TimerHandler *timerHandlerPtr, *prevPtr; - ThreadSpecificData *tsdPtr; + ThreadSpecificData *tsdPtr = InitTimer(); + + if (token == NULL) { + return; + } - tsdPtr = InitTimer(); for (timerHandlerPtr = tsdPtr->firstTimerHandlerPtr, prevPtr = NULL; timerHandlerPtr != NULL; prevPtr = timerHandlerPtr, timerHandlerPtr = timerHandlerPtr->nextPtr) { -- cgit v0.12