Ignore:
Timestamp:
Sep 30, 2010, 4:34:31 PM (14 years ago)
Author:
Christoph Mayer
Message:

-memleaks

Location:
source/ariba/utility/transport/tcpip/protlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/transport/tcpip/protlib/tp_over_tcp.cpp

    r7040 r8606  
    253253        if (newmsg)
    254254        {
    255           newmsg->send_to(tpparam.source);
     255          bool ret = newmsg->send_to(tpparam.source);
     256          if(!ret) delete newmsg;
    256257          return assoc;
    257258        }
     
    413414    // both parameters will be freed after message was sent!
    414415   
    415     TPoverTCPMsg* internalmsg= new TPoverTCPMsg(netmsg,new appladdress(*addr));
     416    appladdress* apl=new appladdress(*addr);
     417    TPoverTCPMsg* internalmsg= new TPoverTCPMsg(netmsg,apl);
    416418    if (internalmsg)
    417419    {
    418420      // send the internal message to the sender thread queue
    419       internalmsg->send(tpparam.source,destqueue);
     421      bool sent = internalmsg->send(tpparam.source,destqueue);
     422      if (!sent) {
     423          delete internalmsg->get_appladdr();
     424          delete internalmsg;
     425          internalmsg = NULL;
     426      }
    420427    }
    421428  }
     
    659666    if (internalmsg == 0)
    660667    {
    661       ERRLog(tpparam.name, methodname << "received not an TPoverTCPMsg but a" << internal_thread_msg->get_type_name());     
     668      ERRLog(tpparam.name, methodname << "received not an TPoverTCPMsg but a" << internal_thread_msg->get_type_name());
    662669    }
    663670    else
     
    694701    {
    695702      terminate= true;
    696     } 
     703    }
     704
     705    delete internalmsg;
    697706  } // end while
    698707 
     
    929938        if ( ret < 0 )
    930939        {
     940          delete netmsg;
    931941          if (errno!=EAGAIN && errno!=EWOULDBLOCK)
    932942          {
     
    11061116
    11071117  receiver_thread_argp->terminated= true;
     1118  delete netmsg;
    11081119
    11091120  Log(DEBUG_LOG,LOG_NORMAL, tpparam.name, methodname << "Thread <" << pthread_self() << "> terminated");
     
    17011712{
    17021713  init= false;
     1714  this->connmap.clear();
    17031715
    17041716  Log(DEBUG_LOG,LOG_NORMAL, tpparam.name,  "Destructor called");
  • source/ariba/utility/transport/tcpip/protlib/tp_over_tcp.h

    r7038 r8606  
    247247    message(type_transport, source), peer_assoc(0), type(send_data), netmsg(netmsg), addr(addr) {}
    248248
     249  virtual ~TPoverTCPMsg() {}
     250
    249251  const AssocData* get_peer_assoc() const { return peer_assoc; }
    250252  TPoverTCPMsg::msg_t get_msgtype() const { return type; }
Note: See TracChangeset for help on using the changeset viewer.