From 56543fa0c7c8e92a30cd63a3b8cac9b6755f47ce Mon Sep 17 00:00:00 2001 From: karliss Date: Tue, 14 Apr 2020 10:58:25 +0300 Subject: [PATCH] Fix memory leak in listFlagsAsStringsAt. (#2145) --- src/core/Cutter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index 83a3afc0..3b479938 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -3483,7 +3483,10 @@ void CutterCore::addFlag(RVA offset, QString name, RVA size) QString CutterCore::listFlagsAsStringAt(RVA addr) { CORE_LOCK(); - return r_flag_get_liststr (core->flags, addr); + char *flagList = r_flag_get_liststr (core->flags, addr); + QString result(flagList); + r_mem_free(flagList); + return result; } QString CutterCore::nearestFlag(RVA offset, RVA *flagOffsetOut)