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 authored and Sam Lantinga committed 2025-10-20 00:13:09 -07:00
1 parent 2f810e0a5f
commit aaee09d6ed
40 files changed
+76 -229

No files matched your search

+1 -3
View File
@@ -1041,9 +1041,7 @@ static void SDLCALL OnlyControllersChanged(void *userdata, const char *name, con
static void SDLCALL IgnoredDevicesChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
{
if (SDL_hidapi_ignored_devices) {
SDL_free(SDL_hidapi_ignored_devices);
}
SDL_free(SDL_hidapi_ignored_devices);
if (hint && *hint) {
SDL_hidapi_ignored_devices = SDL_strdup(hint);
} else {