From 68f604de8e2f50b951f3c16e791563009120c12f Mon Sep 17 00:00:00 2001 From: zawz Date: Fri, 29 Jan 2021 12:04:51 +0100 Subject: [PATCH] fix memory leak on variable set --- include/struc.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/struc.hpp b/include/struc.hpp index 632bc7d..c4dfc81 100644 --- a/include/struc.hpp +++ b/include/struc.hpp @@ -291,7 +291,10 @@ public: cmd(arglist* in=nullptr) { type=_obj::block_cmd; args=in; } ~cmd() { if(args!=nullptr) delete args; - for(auto it: var_assigns) delete it.second; + for(auto it: var_assigns) { + delete it.first; + delete it.second; + } } static const std::string empty_string;