summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2013-08-04 13:39:09 +0200
committerJens Geyer <jensg@apache.org>2013-08-04 13:39:09 +0200
commit09b97c78de58fea61b5dc90bd56095515bdd4f02 (patch)
tree6ef6ee741a0c6c977dfb347603b1e07f994b1114
parent656a17305093a1fda754b669f4cb9ce4e98ec2d1 (diff)
downloadthrift-09b97c78de58fea61b5dc90bd56095515bdd4f02.tar.gz
THRIFT-2017 Resource Leak in thrift struct under compiler/cpp/src/parse/t_program.h
Patch: kuldeep gupta
-rw-r--r--compiler/cpp/src/parse/t_program.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/cpp/src/parse/t_program.h b/compiler/cpp/src/parse/t_program.h
index f22da0737..96a8a5cc3 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_; }