Remove un-needed check for NULL pointer. They were previously checked just before.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c
index 8b74f57..b4fe231 100644
--- a/src/core/linux/SDL_ibus.c
+++ b/src/core/linux/SDL_ibus.c
@@ -549,10 +549,8 @@ SDL_IBus_Init(void)
inotify_wd = inotify_add_watch(inotify_fd, addr_file, IN_CREATE | IN_MODIFY);
SDL_free(addr_file);
- if (addr) {
- result = IBus_SetupConnection(dbus, addr);
- SDL_free(addr);
- }
+ result = IBus_SetupConnection(dbus, addr);
+ SDL_free(addr);
}
return result;
diff --git a/src/power/linux/SDL_syspower.c b/src/power/linux/SDL_syspower.c
index f4e1ecc..c33ab5c 100644
--- a/src/power/linux/SDL_syspower.c
+++ b/src/power/linux/SDL_syspower.c
@@ -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);
}
- if (dbus) {
- dbus->free_string_array(paths);
- }
+ dbus->free_string_array(paths);
#endif /* SDL_USE_LIBDBUS */
return retval;
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 722147c..5f821b3 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -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. */
renderer->render_command_generation = 1;
- if (window && renderer->GetOutputSize) {
+ if (renderer->GetOutputSize) {
int window_w, window_h;
int output_w, output_h;
if (renderer->GetOutputSize(renderer, &output_w, &output_h) == 0) {
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 1ac9165..45965e3 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -1302,9 +1302,8 @@ SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode)
return SDL_SetError("Couldn't find display mode match");
}
- if (mode) {
- *mode = fullscreen_mode;
- }
+ *mode = fullscreen_mode;
+
return 0;
}
diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index 4293e46..eae7214 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -308,8 +308,8 @@ KMSDRM_CreateDevice(void)
return device;
cleanup:
- if (device)
- SDL_free(device);
+ SDL_free(device);
+
if (viddata)
SDL_free(viddata);
return NULL;