From 84fbe26e8a9507a76637b41da160a867aa2d4720 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Fri, 15 Feb 2019 12:33:58 +0100 Subject: [PATCH] Memory leak fix in Realloc_brush() --- src/brush.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/brush.c b/src/brush.c index 26520cf8..20a32125 100644 --- a/src/brush.c +++ b/src/brush.c @@ -760,15 +760,15 @@ byte Realloc_brush(word new_brush_width, word new_brush_height, byte *new_brush, // Save or free the old brush pixels if (old_brush) - *old_brush=Brush_original_pixels; + *old_brush = Brush_original_pixels; else - free(old_brush); - Brush_original_pixels=new_brush; + free(Brush_original_pixels); + Brush_original_pixels = new_brush; // Assign new brush if (new_brush_remapped) { free(Brush); - Brush=new_brush_remapped; + Brush = new_brush_remapped; } return 0; }