Call SDL_OutOfMemory() if SDL_malloc() fails.

--HG--
branch : SDL-1.2
This commit is contained in:
Ryan C. Gordon
2010-01-06 06:41:41 +00:00
parent fb5a13f95e
commit 8148e9def0

View File

@@ -113,6 +113,7 @@ SDL_Joystick *SDL_JoystickOpen(int device_index)
/* Create and initialize the joystick */
joystick = (SDL_Joystick *)SDL_malloc((sizeof *joystick));
if ( !joystick ) {
SDL_OutOfMemory();
return(NULL);
}