From 3e70553c48032f6bf4b6acfa61e4ef87d563c1a1 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Fri, 18 Nov 2022 11:06:49 +0100 Subject: [PATCH] Unneed test before calling SDL_FreeSurface --- src/video/SDL_bmp.c | 4 +--- test/testutils.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index d52d6e84e..369b925a6 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -574,9 +574,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) if (src) { SDL_RWseek(src, fp_offset, RW_SEEK_SET); } - if (surface) { - SDL_FreeSurface(surface); - } + SDL_FreeSurface(surface); surface = NULL; } if (freesrc && src) { diff --git a/test/testutils.c b/test/testutils.c index ab58824d0..a93afc1ad 100644 --- a/test/testutils.c +++ b/test/testutils.c @@ -143,9 +143,7 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent, SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError()); } } - if (temp) { - SDL_FreeSurface(temp); - } + SDL_FreeSurface(temp); if (path) { SDL_free(path); }