Remove un-needed check for NULL pointer. They were previously checked just before.

This commit is contained in:
Sylvain 2022-11-16 21:27:16 +01:00
parent 8ea96f365f
commit 1d7966df15
No known key found for this signature in database
GPG Key ID: 5F87E02E5BC0939E
5 changed files with 8 additions and 13 deletions

View File

@ -549,10 +549,8 @@ SDL_IBus_Init(void)
inotify_wd = inotify_add_watch(inotify_fd, addr_file, IN_CREATE | IN_MODIFY); inotify_wd = inotify_add_watch(inotify_fd, addr_file, IN_CREATE | IN_MODIFY);
SDL_free(addr_file); SDL_free(addr_file);
if (addr) { result = IBus_SetupConnection(dbus, addr);
result = IBus_SetupConnection(dbus, addr); SDL_free(addr);
SDL_free(addr);
}
} }
return result; return result;

View File

@ -648,9 +648,7 @@ SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *second
check_upower_device(dbus->system_conn, paths[i], state, seconds, percent); check_upower_device(dbus->system_conn, paths[i], state, seconds, percent);
} }
if (dbus) { dbus->free_string_array(paths);
dbus->free_string_array(paths);
}
#endif /* SDL_USE_LIBDBUS */ #endif /* SDL_USE_LIBDBUS */
return retval; return retval;

View File

@ -1078,7 +1078,7 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags)
/* new textures start at zero, so we start at 1 so first render doesn't flush by accident. */ /* new textures start at zero, so we start at 1 so first render doesn't flush by accident. */
renderer->render_command_generation = 1; renderer->render_command_generation = 1;
if (window && renderer->GetOutputSize) { if (renderer->GetOutputSize) {
int window_w, window_h; int window_w, window_h;
int output_w, output_h; int output_w, output_h;
if (renderer->GetOutputSize(renderer, &output_w, &output_h) == 0) { if (renderer->GetOutputSize(renderer, &output_w, &output_h) == 0) {

View File

@ -1302,9 +1302,8 @@ SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode)
return SDL_SetError("Couldn't find display mode match"); return SDL_SetError("Couldn't find display mode match");
} }
if (mode) { *mode = fullscreen_mode;
*mode = fullscreen_mode;
}
return 0; return 0;
} }

View File

@ -308,8 +308,8 @@ KMSDRM_CreateDevice(void)
return device; return device;
cleanup: cleanup:
if (device) SDL_free(device);
SDL_free(device);
if (viddata) if (viddata)
SDL_free(viddata); SDL_free(viddata);
return NULL; return NULL;