diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-01-28 23:26:16 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-01-28 23:26:16 +0000 |
commit | 6c215bd2bc46c1c551b867ed2b65613989210741 (patch) | |
tree | 64f94770be89c00cdafd67b47d27ff455663f60c | |
parent | dbb60c7476dc7495ba24c9c1cbf3dd48a1feba4c (diff) | |
download | ATCD-6c215bd2bc46c1c551b867ed2b65613989210741.tar.gz |
Fix sent in by Alex Arulanthu. Stops memory leak for sequences of
length 0.
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp index 6865b709e35..9ef8eba4db0 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp @@ -186,7 +186,12 @@ be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node) } *os << "// set the length of the sequence" << be_nl - << "_tao_sequence.length (_tao_seq_len);" << be_nl; + + // Now we do a check for the sequence length to be non zero. + // If length is 0 we return true. + *os << "// If length is 0 we return true." << be_nl; + *os << "if (0 >= _tao_seq_len) " << be_idt_nl; + *os << "return 1;" << be_uidt_nl; *os << "// retrieve all the elements" << be_nl; |