Don't do NULL-checks before SDL_free()

Replaces the pattern

  if (ptr) {
    SDL_free(ptr);
  }

with

  SDL_free(ptr);
This commit is contained in:
Eddy Jansson
2025-10-19 11:07:48 +02:00
committed by Sam Lantinga
parent 2f810e0a5f
commit aaee09d6ed
40 changed files with 76 additions and 229 deletions

View File

@@ -2075,9 +2075,7 @@ static void SDLCALL SDLTest_ScreenShotClipboardCleanup(void *context)
SDL_Log("Cleaning up screenshot image data");
if (data->image) {
SDL_free(data->image);
}
SDL_free(data->image);
SDL_free(data);
}