Added a safety-check on a memory allocation. (Timers were using

dynamic memory allocation but NOT checking the result!)


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@223 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
rkrolib 2003-10-11 11:21:27 +00:00
parent 8cad52a9c1
commit a2a78f13a1

View File

@ -110,6 +110,9 @@ void FGAPIENTRY glutTimerFunc( unsigned int timeOut, void (* callback)( int ), i
* Create a new freeglut timer hook structure
*/
timer = (SFG_Timer *)calloc( sizeof(SFG_Timer), 1 );
if (!timer)
fgError ("Fatal error: "
"Memory allocation failure in glutTimerFunc()\n");
/*
* Remember the callback address and timer hook's ID