An Overlay-based
Virtual Network Substrate
SpoVNet

Changeset 8606 for source


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

-memleaks

Location:
source/ariba
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/communication/BaseCommunication.cpp

    r8597 r8606  
    294294                receiveMessage(msg, dmsg->local, dmsg->remote);
    295295                msg->dropPayload();
     296                delete dmsg->local;
     297                delete dmsg->remote;
     298                delete msg;
    296299                delete dmsg;
    297                 delete msg;
    298300        }
    299301}
     
    399401                                ld->remoteLocator, endpoint_set::Layer1_3 | endpoint_set::NoLoopback);
    400402                        localDescriptor.getEndpoints().add(
    401                                 local, endpoint_set::Layer1_3 | endpoint_set::NoLoopback
    402                         );
     403                                local, endpoint_set::Layer1_3 | endpoint_set::NoLoopback);
    403404
    404405                        // link is now up-> add it
  • source/ariba/communication/networkinfo/AddressDiscovery.cpp

    r7744 r8606  
    133133                }
    134134        }
     135
     136        freeifaddrs(ifaceBuffer);
    135137}
    136138
  • source/ariba/overlay/modules/OverlayInterface.h

    r6919 r8606  
    7979
    8080        /**
    81          * Destrcuts the overlay.
     81         * Destructs the overlay.
    8282         */
    8383        virtual ~OverlayInterface();
  • source/ariba/overlay/modules/chord/detail/chord_routing_table.hpp

    r6919 r8606  
    184184        }
    185185
     186        virtual ~chord_routing_table() {
     187                BOOST_FOREACH( finger_table* f, this->finger){
     188                        delete f;
     189                }
     190        }
     191
    186192        /// check whether a node could fit the routing table
    187193        bool is_insertable( const nodeid_t& value ) {
  • 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; }
  • source/ariba/utility/transport/tcpip/tcpip.cpp

    r6919 r8606  
    9696
    9797        // unregister TPoverTCP
     98        delete QueueManager::instance()->get_queue( message::qaddr_signaling );
    9899        QueueManager::instance()->unregister_queue( message::qaddr_signaling );
    99100
     
    104105        protlib::setuid::end();
    105106        protlib::tsdb::end();
     107
     108        // wait for thread to finish and delete
     109        pthread_join(tpreceivethread, NULL);
    106110}
    107111
     
    167171                TPMsg* tpmsg = dynamic_cast<TPMsg*> (msg);
    168172                if (!tpmsg) {
     173                        delete msg;
    169174                        continue;
    170175                }
     
    177182                // not a data message? -> continue!
    178183                if (!datamsg) {
     184                        delete tpmsg;
    179185                        continue;
    180186                }
     
    184190                uint32_t message_size = datamsg->decode32(true)-2;
    185191                //uint16_t remote_port = datamsg->decode16(true);
    186 
    187192
    188193                // inform listener
     
    194199
    195200                }
     201                delete datamsg;
    196202                delete tpmsg;
    197203        }
Note: See TracChangeset for help on using the changeset viewer.