Fix malloc warning in timer.c