Updated Branches:
  refs/heads/master 656a17305 -> 09b97c78d

THRIFT-2017 Resource Leak in thrift struct under 
compiler/cpp/src/parse/t_program.h

Patch: kuldeep gupta


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/09b97c78
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/09b97c78
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/09b97c78

Branch: refs/heads/master
Commit: 09b97c78de58fea61b5dc90bd56095515bdd4f02
Parents: 656a173
Author: Jens Geyer <[email protected]>
Authored: Sun Aug 4 13:39:09 2013 +0200
Committer: Jens Geyer <[email protected]>
Committed: Sun Aug 4 13:39:09 2013 +0200

----------------------------------------------------------------------
 compiler/cpp/src/parse/t_program.h | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/09b97c78/compiler/cpp/src/parse/t_program.h
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/parse/t_program.h 
b/compiler/cpp/src/parse/t_program.h
index f22da07..96a8a5c 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_; }
 

Reply via email to