tcpdump mailing list archives

Re: Memory leak in libpcap (top of tree) and/or


From: Stephen Donnelly <stephen () endace com>
Date: Mon, 13 Jul 2009 09:11:29 +1200

Guy Harris wrote:
Spot the potential leaks:

    $ egrep -l 'mmap\(' *.c
    pcap-bpf.c
    pcap-dag.c
    pcap-linux.c
    pcap-usb-linux.c

    $ egrep -l 'munmap\(' *.c
    pcap-bpf.c
    pcap-linux.c

I suspect the close routines for Linux USB devices - and DAG devices - need to unmap any buffer they have.

I believe the current code to support DAG cards correctly cleans up and unmaps any memmapped space.

The dag_mmap() call is a legacy interface that is cleaned up inside dag_close(), so there no matching *munmap() call. DAG Streams API code uses dag_attach_stream() and dag_detach_stream() to handle mapping/unmapping.

Stephen.
--
-----------------------------------------------------------------------
    Stephen Donnelly BCMS PhD           email: sfd () endace com
    Endace Technology Ltd               phone: +64 7 839 0540
    Hamilton, New Zealand               cell:  +64 21 1104378
-----------------------------------------------------------------------
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: