diff --git a/src/sdl/texture.cpp b/src/sdl/texture.cpp index a4f943cdf6b..06d63d14f5e 100644 --- a/src/sdl/texture.cpp +++ b/src/sdl/texture.cpp @@ -51,6 +51,7 @@ ttexture::ttexture(SDL_Renderer& renderer, texture_ = SDL_CreateTextureFromSurface(&renderer, img); if (texture_ == NULL) { + SDL_FreeSurface(img); throw texception("Failed to create SDL_Texture object.", true); }