[Winpcap-users] pcap_list_datalinks() - how to free
Gianluca Varenni
gianluca.varenni at cacetech.com
Wed May 21 17:58:45 GMT 2008
----- Original Message -----
From: "Esmond Pitt" <esmond.pitt at bigpond.com>
To: <winpcap-users at winpcap.org>
Sent: Tuesday, May 20, 2008 11:35 PM
Subject: [Winpcap-users] pcap_list_datalinks() - how to free
> The documentation for the pcap_list_datalinks() function says that the
> user
> is responsible for freeing the array of integers allocated by the
> function.
>
> As no specific function to do that is provided, presumably we are supposed
> to use free(3). But in a DLL environment this is of course most
> problematic,
> and indeed causes SEGVs when I do it.
>
> I think you need to add a pcap_free_datalinks() function. Or is there some
> other solution?
No other solution. This function was created within the linux/unix
environment, where it's safe to call malloc/free from across DLLs/shared
object boundaries (while it's not under Windows with the MS CRT).
In the next days I will try to commit an implementation of
pcap_free_datalinks() in the libpcap source tree.
Have a nice day
GV
>
> EJP
>
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
More information about the Winpcap-users
mailing list