From 3b2eae4f4979e1492853c56167a2b213123bb77e Mon Sep 17 00:00:00 2001 From: electron128 Date: Fri, 1 Jan 2016 12:17:08 +0100 Subject: [PATCH] fixed memory leak by using stack memory instead of heap memory --- retroshare-gui/src/util/HandleRichText.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index 15945a791..59466b827 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -587,9 +587,9 @@ static void optimizeHtml(QDomDocument& doc if (pair.length()!=2) return; //Malformed style list so a bad message or last item. QString keyvalue = pair.at(1); keyvalue.replace(";",""); - QStringList* classUsingIt = new QStringList(pair.at(0).split(',')); + QStringList classUsingIt(pair.at(0).split(',')); QStringList* exported = new QStringList(); - foreach (QString keyVal, *classUsingIt) { + foreach (QString keyVal, classUsingIt) { if(!keyVal.trimmed().isEmpty()) { exported->append(keyVal.trimmed().replace(".","")); }