diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2011-05-23 06:57:42 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2011-05-23 06:57:42 +0000 |
commit | c9aa228cb19e955d80971f572ca3da448b0d81a8 (patch) | |
tree | 87d44912518e4ff0bf18630cd27334686b7da385 /ACE/protocols | |
parent | bdca10fc79afb1eeca18f847804966fcb1c5208e (diff) | |
download | ATCD-c9aa228cb19e955d80971f572ca3da448b0d81a8.tar.gz |
Mon May 23 06:55:37 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
* examples/APG/Streams/MessageInfo.h:
Pass argument as const& to fix Coverity error
* protocols/ace/INet/BidirStreamBuffer.h:
* protocols/ace/INet/BufferedStreamBuffer.h:
* protocols/ace/INet/HTTP_BasicAuthentication.cpp:
* protocols/ace/RMCast/Link.cpp:
Fixed memory leaks, thanks to Max Zhou <earthdog at 126 dot com>
for creating the patch, this fixes bugzilla 3959
Diffstat (limited to 'ACE/protocols')
-rw-r--r-- | ACE/protocols/ace/INet/BidirStreamBuffer.h | 4 | ||||
-rw-r--r-- | ACE/protocols/ace/INet/BufferedStreamBuffer.h | 2 | ||||
-rw-r--r-- | ACE/protocols/ace/INet/HTTP_BasicAuthentication.cpp | 6 | ||||
-rw-r--r-- | ACE/protocols/ace/RMCast/Link.cpp | 6 |
4 files changed, 7 insertions, 11 deletions
diff --git a/ACE/protocols/ace/INet/BidirStreamBuffer.h b/ACE/protocols/ace/INet/BidirStreamBuffer.h index 5ee3db92caa..8238be85d73 100644 --- a/ACE/protocols/ace/INet/BidirStreamBuffer.h +++ b/ACE/protocols/ace/INet/BidirStreamBuffer.h @@ -89,8 +89,8 @@ namespace ACE int flush_buffer (); std::streamsize bufsize_; - ACE_Auto_Ptr<char_type> read_buffer_; - ACE_Auto_Ptr<char_type> write_buffer_; + ACE_Auto_Array_Ptr<char_type> read_buffer_; + ACE_Auto_Array_Ptr<char_type> write_buffer_; openmode mode_; STREAM_HANDLER *stream_; interceptor_type* interceptor_; diff --git a/ACE/protocols/ace/INet/BufferedStreamBuffer.h b/ACE/protocols/ace/INet/BufferedStreamBuffer.h index 317070c3817..8127667b983 100644 --- a/ACE/protocols/ace/INet/BufferedStreamBuffer.h +++ b/ACE/protocols/ace/INet/BufferedStreamBuffer.h @@ -82,7 +82,7 @@ namespace ACE int flush_buffer (); std::streamsize bufsize_; - ACE_Auto_Ptr<char_type> buffer_; + ACE_Auto_Array_Ptr<char_type> buffer_; typename std::basic_ios<ACE_CHAR_T, TR>::openmode mode_; interceptor_type* interceptor_; diff --git a/ACE/protocols/ace/INet/HTTP_BasicAuthentication.cpp b/ACE/protocols/ace/INet/HTTP_BasicAuthentication.cpp index 24d5557fdd6..e50c554a4e4 100644 --- a/ACE/protocols/ace/INet/HTTP_BasicAuthentication.cpp +++ b/ACE/protocols/ace/INet/HTTP_BasicAuthentication.cpp @@ -38,8 +38,8 @@ namespace ACE if (scheme == SCHEME) { size_t out_len = 0; - ACE_Auto_Ptr<ACE_Byte> safe_buf (ACE_Base64::decode ((const ACE_Byte*)info.c_str (), - &out_len)); + ACE_Auto_Array_Ptr<ACE_Byte> safe_buf (ACE_Base64::decode ((const ACE_Byte*)info.c_str (), + &out_len)); ACE_CString credentials ((char*)safe_buf.get (), out_len); ACE_CString::size_type pos = credentials.find (':'); if (pos != ACE_CString::npos) @@ -61,7 +61,7 @@ namespace ACE credentials += ':'; credentials += this->passwd_; size_t out_len = 0; - ACE_Auto_Ptr<ACE_Byte> safe_buf ( + ACE_Auto_Array_Ptr<ACE_Byte> safe_buf ( ACE_Base64::encode ((const ACE_Byte*)credentials.c_str (), credentials.length (), &out_len, diff --git a/ACE/protocols/ace/RMCast/Link.cpp b/ACE/protocols/ace/RMCast/Link.cpp index a863addfec2..e1329ac346a 100644 --- a/ACE/protocols/ace/RMCast/Link.cpp +++ b/ACE/protocols/ace/RMCast/Link.cpp @@ -187,11 +187,7 @@ namespace ACE_RMCast { size_t max_packet_size (params_.max_packet_size ()); - // This is wicked. - // - ACE_Auto_Ptr<char> holder ( - reinterpret_cast<char*> ( - operator new (max_packet_size + ACE_CDR::MAX_ALIGNMENT))); + ACE_Auto_Array_Ptr<char> holder (new char[max_packet_size + ACE_CDR::MAX_ALIGNMENT]); char* data = ACE_ptr_align_binary (holder.get (), ACE_CDR::MAX_ALIGNMENT); |