Don't allocate more than needed

This commit is contained in:
simon.kagstrom 2010-01-24 08:38:37 +00:00
parent b7c9a8c4df
commit 3272171245

View File

@ -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;