From 09b97c78de58fea61b5dc90bd56095515bdd4f02 Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Sun, 4 Aug 2013 13:39:09 +0200 Subject: [PATCH] THRIFT-2017 Resource Leak in thrift struct under compiler/cpp/src/parse/t_program.h Patch: kuldeep gupta --- compiler/cpp/src/parse/t_program.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/cpp/src/parse/t_program.h b/compiler/cpp/src/parse/t_program.h index f22da073..96a8a5cc 100644 --- a/compiler/cpp/src/parse/t_program.h +++ b/compiler/cpp/src/parse/t_program.h @@ -73,6 +73,15 @@ class t_program : public t_doc { scope_ = new t_scope(); } + ~t_program() + { + if(scope_) + { + delete scope_; + scope_ = NULL; + } + } + // Path accessor const std::string& get_path() const { return path_; } -- 2.17.1