--- a/src/click/model/ipv4-click-routing.cc Mon May 23 15:08:30 2011 +0100 +++ a/src/click/model/ipv4-click-routing.cc Thu May 26 12:27:50 2011 +0100 @@ -115,6 +115,7 @@ Ipv4ClickRouting::DoDispose () { m_ipv4 = 0; + simclick_click_kill (m_simNode); delete m_simNode; Ipv4RoutingProtocol::DoDispose (); } @@ -369,7 +370,14 @@ std::string Ipv4ClickRouting::ReadHandler (std::string elementName, std::string handlerName) { - std::string s = simclick_click_read_handler (m_simNode, elementName.c_str (), handlerName.c_str (), 0, 0); + char *handle = simclick_click_read_handler (m_simNode, elementName.c_str (), handlerName.c_str (), 0, 0); + std::string ret (handle); + + // This is required because Click does not free + // the memory allocated to the return string + // from simclick_click_read_handler() + delete handle; + return s; }