mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.91k stars 375 forks source link

Fix possible memory leak in active tests #341

Closed m-peko closed 5 years ago

m-peko commented 5 years ago

Fix for issue #339

mfontanini commented 5 years ago

While in theory this is an issue, in practice it isn't. The only way for this to have a leak is if emplace_back throws and the only way it would throw in this scenario is if you ran out of memory and at that point, you have worse issues. Anyway, I'll merge it but I don't think you'd ever hit this condition in practice.