Skip to content

Commit

Permalink
Fixed memory leaks reported by Coverity
Browse files Browse the repository at this point in the history
    * TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp:
    * TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy.cpp:
  • Loading branch information
jwillemsen committed Sep 14, 2016
1 parent 851196b commit 5f217dc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
11 changes: 8 additions & 3 deletions TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,14 @@ TAO_StreamCtrl::bind_devs (AVStreams::MMDevice_ptr a_party,

if (TAO_debug_level > 0) ORBSVCS_DEBUG ((LM_DEBUG, "(%P|%t) TAO_StreamCtrl::create_B: succeeded\n"));

if (TAO_debug_level > 0) ORBSVCS_DEBUG ((LM_DEBUG,
"\n(%P|%t)stream_endpoint_b_ = %s",
TAO_ORB_Core_instance ()->orb ()->object_to_string (this->sep_b_.in ())));
if (TAO_debug_level > 0)
{
CORBA::String_var ep = TAO_ORB_Core_instance ()->orb ()->object_to_string (this->sep_b_.in ());
ORBSVCS_DEBUG ((LM_DEBUG,
"\n(%P|%t)stream_endpoint_b_ = <%C>",
ep.in ()));
}

// Define ourselves as the related_streamctrl property of the sep.
CORBA::Any streamctrl_any;
streamctrl_any <<= this->streamctrl_.in ();
Expand Down
14 changes: 6 additions & 8 deletions TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

//=============================================================================
/**
* @file Endpoint_Strategy.cpp
Expand All @@ -7,7 +6,6 @@
*/
//=============================================================================


#include "orbsvcs/Log_Macros.h"
#include "orbsvcs/Log_Macros.h"
#include "orbsvcs/AV/Endpoint_Strategy.h"
Expand All @@ -17,8 +15,6 @@

#include "ace/Process_Semaphore.h"



TAO_BEGIN_VERSIONED_NAMESPACE_DECL

// ----------------------------------------------------------------------
Expand All @@ -33,7 +29,6 @@ TAO_AV_Endpoint_Strategy::TAO_AV_Endpoint_Strategy (void)
// Destructor.
TAO_AV_Endpoint_Strategy::~TAO_AV_Endpoint_Strategy (void)
{

}

// The base class defines the "failure" case, so that unless the
Expand Down Expand Up @@ -62,7 +57,6 @@ TAO_AV_Endpoint_Strategy::create_B (AVStreams::StreamEndPoint_B_ptr & /* stream_
-1);
}


// ----------------------------------------------------------------------
// TAO_AV_Endpoint_Process_Strategy
// ----------------------------------------------------------------------
Expand Down Expand Up @@ -339,8 +333,12 @@ TAO_AV_Endpoint_Process_Strategy_B::create_B (AVStreams::StreamEndPoint_B_ptr &s
"(%P|%t) TAO_AV_Endpoint_Process_Strategy: Error in activate ()\n"),
-1);

if (TAO_debug_level > 0) ORBSVCS_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Process_Strategy_B::create_B ()\n: stream_endpoint is:%s\n",
TAO_ORB_Core_instance ()->orb ()->object_to_string (this->stream_endpoint_b_.in())));
if (TAO_debug_level > 0)
{
CORBA::String_var ep = TAO_ORB_Core_instance ()->orb ()->object_to_string (this->stream_endpoint_b_.in());
ORBSVCS_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Process_Strategy_B::create_B ()\n: stream_endpoint is: <%C>\n",
ep.in ()));
}
stream_endpoint = AVStreams::StreamEndPoint_B::_duplicate ( this->stream_endpoint_b_.in() );
vdev = AVStreams::VDev::_duplicate( this->vdev_.in() );
}
Expand Down

0 comments on commit 5f217dc

Please sign in to comment.