From 6c0c27f662dc1a41f3e9490eac32735b4e486a30 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Mon, 10 Aug 2015 08:36:55 +0200 Subject: [PATCH] Fix intlGUIEditBox leak and uninitialized value in Mapper (reported by valgrind) --- src/guiFormSpecMenu.cpp | 2 ++ src/minimap.cpp | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index f16830619..62a84460f 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -1020,6 +1020,7 @@ void GUIFormSpecMenu::parseSimpleField(parserData* data, if (g_settings->getBool("freetype")) { e = (gui::IGUIElement *) new gui::intlGUIEditBox(spec.fdefault.c_str(), true, Environment, this, spec.fid, rect); + e->drop(); } else { #else { @@ -1119,6 +1120,7 @@ void GUIFormSpecMenu::parseTextArea(parserData* data, if (g_settings->getBool("freetype")) { e = (gui::IGUIEditBox *) new gui::intlGUIEditBox(spec.fdefault.c_str(), true, Environment, this, spec.fid, rect); + e->drop(); } else { #else { diff --git a/src/minimap.cpp b/src/minimap.cpp index 950202c6a..d1fb3867d 100644 --- a/src/minimap.cpp +++ b/src/minimap.cpp @@ -224,12 +224,13 @@ Mapper::Mapper(IrrlichtDevice *device, Client *client) // Initialize minimap data data = new MinimapData; - data->mode = MINIMAP_MODE_OFF; - data->is_radar = false; - data->map_invalidated = true; - data->heightmap_image = NULL; - data->minimap_image = NULL; - data->texture = NULL; + data->mode = MINIMAP_MODE_OFF; + data->is_radar = false; + data->map_invalidated = true; + data->heightmap_image = NULL; + data->minimap_image = NULL; + data->texture = NULL; + data->heightmap_texture = NULL; data->minimap_shape_round = g_settings->getBool("minimap_shape_round"); // Get round minimap textures -- 2.25.1