summaryrefslogtreecommitdiff
path: root/ace/Connector.cpp
diff options
context:
space:
mode:
authornw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-10-26 06:44:42 +0000
committernw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-10-26 06:44:42 +0000
commit710fb22d86ecdf4a8ad4608ce5c46a293208a077 (patch)
tree10d56d0b5b9f0f3643e690ecca9fe28ff4b4c89c /ace/Connector.cpp
parent498be8a80c41f11f6e80100d68fd095c11e3a575 (diff)
downloadATCD-710fb22d86ecdf4a8ad4608ce5c46a293208a077.tar.gz
Have to check if we enter open the second time to avoid memory coruption.
Diffstat (limited to 'ace/Connector.cpp')
-rw-r--r--ace/Connector.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/ace/Connector.cpp b/ace/Connector.cpp
index 6eda7b9fe5a..80975e61d94 100644
--- a/ace/Connector.cpp
+++ b/ace/Connector.cpp
@@ -647,7 +647,15 @@ ACE_Strategy_Connector<SH, PR_CO_2>::open
// Initialize the creation strategy.
- if (cre_s == 0)
+ if (this->creation_strategy_ != 0 &&
+ this->delete_creation_strategy_ != 0)
+ {
+ delete this->creation_strategy_;
+ this->creation_strategy_ = 0;
+ this->delete_creation_strategy_ = 0;
+ }
+
+ if (cre_s == 0 && this->creation_strategy_ == 0)
{
ACE_NEW_RETURN (cre_s, CREATION_STRATEGY, -1);
this->delete_creation_strategy_ = 1;
@@ -656,7 +664,15 @@ ACE_Strategy_Connector<SH, PR_CO_2>::open
// Initialize the accept strategy.
- if (conn_s == 0)
+ if (this->connect_strategy_ != 0 &&
+ this->delete_connect_strategy_ != 0)
+ {
+ delete this->connect_strategy_;
+ this->connect_strategy_ = 0;
+ this->delete_connect_strategy_ = 0;
+ }
+
+ if (conn_s == 0 && this->connect_strategy_ == 0)
{
ACE_NEW_RETURN (conn_s, CONNECT_STRATEGY, -1);
this->delete_connect_strategy_ = 1;
@@ -665,7 +681,16 @@ ACE_Strategy_Connector<SH, PR_CO_2>::open
// Initialize the concurrency strategy.
- if (con_s == 0)
+ if (this->concurrency_strategy_ != 0 &&
+ this->delete_concurrency_strategy_ != 0 &&
+ con_s != 0)
+ {
+ delete this->concurrency_strategy_;
+ this->concurrency_strategy_ = 0;
+ this->delete_concurrency_strategy_ = 0;
+ }
+
+ if (con_s == 0 && this->concurrency_strategy_ == 0)
{
ACE_NEW_RETURN (con_s, CONCURRENCY_STRATEGY, -1);
this->delete_concurrency_strategy_ = 1;