projects
/
freeglut
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c098c34
)
Added a safety-check on a memory allocation. (Timers were using
author
Richard Rauch
<rkr@olib.org>
Sat, 11 Oct 2003 11:21:27 +0000
(11:21 +0000)
committer
Richard Rauch
<rkr@olib.org>
Sat, 11 Oct 2003 11:21:27 +0000
(11:21 +0000)
dynamic memory allocation but NOT checking the result!)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@223
7f0cb862
-5218-0410-a997-
914c9d46530a
src/freeglut_callbacks.c
patch
|
blob
|
history
diff --git
a/src/freeglut_callbacks.c
b/src/freeglut_callbacks.c
index
da06283
..
9446315
100644
(file)
--- a/
src/freeglut_callbacks.c
+++ b/
src/freeglut_callbacks.c
@@
-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