From 18409fe5c03264ca74902e263f80523692f76a77 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Mon, 30 Jul 2012 19:43:55 +0200 Subject: WINTERMUTE: Fix a memory leak in BaseScriptHolder --- engines/wintermute/base/base_script_holder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/wintermute/base') diff --git a/engines/wintermute/base/base_script_holder.cpp b/engines/wintermute/base/base_script_holder.cpp index 19bd82f2b0..b40647dc7b 100644 --- a/engines/wintermute/base/base_script_holder.cpp +++ b/engines/wintermute/base/base_script_holder.cpp @@ -287,9 +287,10 @@ bool BaseScriptHolder::persist(BasePersistenceManager *persistMgr) { const char *name = getName(); persistMgr->transfer(TMEMBER(name)); } else { - const char *name; + char *name; persistMgr->transfer(TMEMBER(name)); setName(name); + delete[] name; } _scripts.persist(persistMgr); -- cgit v1.2.3