From 66412a082e2f421686a1a7a830dd956351e71d76 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 17 Nov 2014 00:55:25 +0100 Subject: [PATCH] Fixed memory leak. --- rdtk/librdtk/rdtk_surface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rdtk/librdtk/rdtk_surface.c b/rdtk/librdtk/rdtk_surface.c index 2c02f8ea1..03e64e9e0 100644 --- a/rdtk/librdtk/rdtk_surface.c +++ b/rdtk/librdtk/rdtk_surface.c @@ -59,7 +59,10 @@ rdtkSurface* rdtk_surface_new(rdtkEngine* engine, BYTE* data, int width, int hei surface->data = (BYTE*) malloc(surface->scanline * surface->height); if (!surface->data) + { + free(surface); return NULL; + } ZeroMemory(surface->data, surface->scanline * surface->height);