mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-03 06:09: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
@@ -613,9 +613,7 @@ static bool GL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_P
|
||||
GL_CheckError("", renderer);
|
||||
renderdata->glGenTextures(1, &data->texture);
|
||||
if (!GL_CheckError("glGenTextures()", renderer)) {
|
||||
if (data->pixels) {
|
||||
SDL_free(data->pixels);
|
||||
}
|
||||
SDL_free(data->pixels);
|
||||
SDL_free(data);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1962,9 +1962,7 @@ static bool GLES2_TexSubImage2D(GLES2_RenderData *data, GLenum target, GLint xof
|
||||
}
|
||||
|
||||
data->glTexSubImage2D(target, 0, xoffset, yoffset, width, height, format, type, src);
|
||||
if (blob) {
|
||||
SDL_free(blob);
|
||||
}
|
||||
SDL_free(blob);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user