snake: check allocated memory before use

This commit is contained in:
Anonymous Maarten authored and Anonymous Maarten committed 2024-10-25 17:47:26 +02:00
1 parent 20e01c6fbe
commit 590e1196d0
1 file changed
+3
+3
View File
@@ -310,6 +310,9 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
}
AppState *as = SDL_calloc(1, sizeof(AppState));
if (!as) {
return SDL_APP_FAILURE;
}
*appstate = as;