diff -r 7b2e9458bff1 src/applications/model/ping6.cc --- a/src/applications/model/ping6.cc Sun Apr 17 20:06:22 2011 -0700 +++ b/src/applications/model/ping6.cc Mon Apr 18 10:56:14 2011 +0400 @@ -162,7 +162,7 @@ NS_LOG_FUNCTION_NOARGS (); NS_ASSERT (m_sendEvent.IsExpired ()); Ptr p = 0; - uint8_t data[m_size]; + uint8_t* data = new uint8_t[m_size]; Ipv6Address src; Ptr ipv6 = GetNode ()->GetObject (); @@ -221,6 +221,8 @@ { ScheduleTransmit (m_interval); } + + delete[] data; } void Ping6::HandleRead (Ptr socket) diff -r 7b2e9458bff1 src/applications/model/v4ping.cc --- a/src/applications/model/v4ping.cc Sun Apr 17 20:06:22 2011 -0700 +++ b/src/applications/model/v4ping.cc Mon Apr 18 10:56:14 2011 +0400 @@ -122,7 +122,7 @@ if (i != m_sent.end () && echo.GetIdentifier () == 0) { - uint32_t buf[m_size / 4]; + uint32_t* buf = new uint32_t[m_size / 4]; uint32_t dataSize = echo.GetDataSize (); uint32_t nodeId; uint32_t appId; @@ -153,6 +153,7 @@ } } } + delete[] buf; } } } @@ -192,7 +193,7 @@ // (where any difference would show up anyway) and borrow that code. Don't // be too surprised when you see that this is a little endian convention. // - uint8_t data[m_size]; + uint8_t* data = new uint8_t[m_size]; for (uint32_t i = 0; i < m_size; ++i) data[i] = 0; NS_ASSERT (m_size >= 16); @@ -216,6 +217,7 @@ m_sent.insert (std::make_pair (m_seq - 1, Simulator::Now())); m_socket->Send (p, 0); m_next = Simulator::Schedule (m_interval, & V4Ping::Send, this); + delete[] data; } void