Memory leak with pcap?

24 views
Skip to first unread message

Andjela Mladjenovic

unread,
Nov 29, 2023, 8:11:14 PM11/29/23
to PcapPlusPlus support
Hello, my team and I are creating a project:network-analyzer, using  pcapplusplus with Qt6  for our school. This app should work in real-time it will use filters, and will do some statistics about captured packets. 
I'm having problem understanding how this library  is maniging memory leaking because I don't see that it calls delete in this tutorials (except for reader etc). I saw something in documentation but still i don't understand it  well. 
For example when we wanted to save queue of RawPackets*, we didn't know is that safe, is it okay to only hold pointers in queue, where are real objects, and how should we know it won't be destroyed, will it be seg fault etc. Also how much should i be worried about size of this pacets. Any advice about this subject would be helpful, from storing

Hello, my team and I are working on a project named "network-analyzer" for our school, utilizing PcapPlusPlus with Qt6. This application is designed to operate in real-time, employing filters, and generating statistics about captured packets.

I'm currently facing difficulties in understanding how PcapPlusPlus manages memory, as I haven't observed explicit calls to delete in the tutorials (except for instances like readers). While I've found some information in the documentation, I'm still not entirely clear on the matter.

For instance, when we aimed to store a queue of RawPackets*, we were unsure about its safety. Is it acceptable to exclusively store pointers in the queue, leaving the real objects somewhere, and how can we be certain they won't be destroyed, potentially causing a segmentation fault? Additionally, should I be concerned about the size of these packets?

Any advice on this subject would be greatly appreciated. Specifically, I'm curious about how memory is managed in PcapPlusPlus and if storing this data in the application poses a risk of memory leaks.

Reply all
Reply to author
Forward
0 new messages