summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2018-02-13 19:23:59 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2018-02-13 19:23:59 +0100
commitc8d9edf5117f6aa7334bd63e351e816d4946aece (patch)
treee8d8aed75dea87cc24a31d0bb355e026717f0991
parent220e906922bcfd91013611a19923094f5c95f96b (diff)
downloadATCD-c8d9edf5117f6aa7334bd63e351e816d4946aece.tar.gz
Fixed memory leak when we have a wstrval
* TAO/TAO_IDL/ast/ast_expression.cpp:
-rw-r--r--TAO/TAO_IDL/ast/ast_expression.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/TAO/TAO_IDL/ast/ast_expression.cpp b/TAO/TAO_IDL/ast/ast_expression.cpp
index 8f27b0346a0..aac7235ff2c 100644
--- a/TAO/TAO_IDL/ast/ast_expression.cpp
+++ b/TAO/TAO_IDL/ast/ast_expression.cpp
@@ -3179,11 +3179,19 @@ AST_Expression::ast_accept (ast_visitor *visitor)
void
AST_Expression::destroy (void)
{
- if (0 != this->pd_ev && EV_string == this->pd_ev->et)
+ if (0 != this->pd_ev)
{
- this->pd_ev->u.strval->destroy ();
- delete this->pd_ev->u.strval;
- this->pd_ev->u.strval = 0;
+ if (EV_string == this->pd_ev->et)
+ {
+ this->pd_ev->u.strval->destroy ();
+ delete this->pd_ev->u.strval;
+ this->pd_ev->u.strval = 0;
+ }
+ else if (EV_wstring == this->pd_ev->et)
+ {
+ ACE::strdelete (this->pd_ev->u.wstrval);
+ this->pd_ev->u.wstrval = 0;
+ }
}
delete this->pd_ev;