1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fix memory leak in PDU's move assignment operator

Fixes #272
This commit is contained in:
Matias Fontanini
2017-12-14 14:42:46 -03:00
parent 8f85a6e557
commit f44b253a42
2 changed files with 10 additions and 1 deletions

View File

@@ -83,6 +83,14 @@ TEST_F(PDUTest, OperatorConcatOnPacket) {
EXPECT_TRUE(std::equal(raw->payload().begin(), raw->payload().end(), raw_payload.begin()));
}
#if TINS_IS_CXX11
TEST_F(PDUTest, MoveAssignment) {
IP packet = IP("192.168.0.1") / TCP(22, 52);
packet = IP("1.2.3.4");
EXPECT_TRUE(packet.inner_pdu() == 0);
}
#endif // TINS_IS_CXX11
TEST_F(PDUTest, TinsCast) {
PDU* null_pdu = 0;
TCP tcp;