mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-01 06:44:27 +08:00
snake: check allocated memory before use
This commit is contained in:
committed by
Anonymous Maarten
parent
20e01c6fbe
commit
590e1196d0
@@ -310,6 +310,9 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
AppState *as = SDL_calloc(1, sizeof(AppState));
|
AppState *as = SDL_calloc(1, sizeof(AppState));
|
||||||
|
if (!as) {
|
||||||
|
return SDL_APP_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
*appstate = as;
|
*appstate = as;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user