Index: net/quic/test_tools/quic_test_utils.cc |
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc |
index 51a3d97e28f77ac6ce5bf84c611d865a7cddc99d..3a884cb94e2550767633417c9ecaa81ec4dabe6e 100644 |
--- a/net/quic/test_tools/quic_test_utils.cc |
+++ b/net/quic/test_tools/quic_test_utils.cc |
@@ -295,11 +295,8 @@ PacketSavingConnection::~PacketSavingConnection() { |
} |
void PacketSavingConnection::SendOrQueuePacket(SerializedPacket* packet) { |
- if (!packet->packet->owns_buffer()) { |
- scoped_ptr<QuicEncryptedPacket> encrypted_deleter(packet->packet); |
- packet->packet = packet->packet->Clone(); |
- } |
- encrypted_packets_.push_back(packet->packet); |
+ encrypted_packets_.push_back(new QuicEncryptedPacket( |
+ QuicUtils::CopyBuffer(*packet), packet->encrypted_length, true)); |
// Transfer ownership of the packet to the SentPacketManager and the |
// ack notifier to the AckNotifierManager. |
sent_packet_manager_.OnPacketSent(packet, 0, QuicTime::Zero(), 1000, |