From 32721712453924c7de07d69bfccb5eec8ad0907e Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sun, 24 Jan 2010 08:38:37 +0000 Subject: [PATCH] Don't allocate more than needed --- timer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timer.cpp b/timer.cpp index e1b44a6..3e86679 100644 --- a/timer.cpp +++ b/timer.cpp @@ -34,7 +34,7 @@ int TimerController::arm(TimeoutHandler *which, int ms) { this->n_handlers++; this->handlers = (TimeoutHandler**)xrealloc(this->handlers, - (this->n_handlers + 1) * sizeof(TimeoutHandler*)); + this->n_handlers * sizeof(TimeoutHandler*)); } this->handlers[i] = which; which->timer_id = i;