mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-03 14:19:20 +00:00
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:
committed by
Sam Lantinga
parent
2f810e0a5f
commit
aaee09d6ed
@@ -534,9 +534,7 @@ void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state)
|
||||
if (state->key_maps && state->key_maps != default_key_maps) {
|
||||
int i;
|
||||
for (i = 0; i < MAX_NR_KEYMAPS; ++i) {
|
||||
if (state->key_maps[i]) {
|
||||
SDL_free(state->key_maps[i]);
|
||||
}
|
||||
SDL_free(state->key_maps[i]);
|
||||
}
|
||||
SDL_free(state->key_maps);
|
||||
}
|
||||
|
||||
@@ -563,9 +563,7 @@ bool SDL_IBus_Init(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ibus_addr_file) {
|
||||
SDL_free(ibus_addr_file);
|
||||
}
|
||||
SDL_free(ibus_addr_file);
|
||||
ibus_addr_file = SDL_strdup(addr_file);
|
||||
|
||||
if (inotify_fd < 0) {
|
||||
|
||||
Reference in New Issue
Block a user