<div dir="ltr">Hi,<br><br>While working on Pcap.Net (<a href="http://pcapdotnet.codeplex.com" target="_blank">http://pcapdotnet.codeplex.com</a>), I&#39;ve encountered a problem freeing the allocated memory that was allocated using pcap_list_datalinks().<br>

<br>I saw the 2008 issue - so I&#39;m replying to it.<br><br>There is a function<br>void    pcap_free_datalinks(int *);<br>in pcap.h, but I couldn&#39;t resolve it using the .lib file (while I have no problem with pcap_list_datalinks) and there is no documentation about it in<br>

<a href="http://www.winpcap.org/docs/docs_411/html/group__wpcapfunc.html">http://www.winpcap.org/docs/docs_411/html/group__wpcapfunc.html</a><br><br>What should I do in order to use this function?<br><br>Thank you.<br><br>

Boaz.<br><br>-----------------------------------------------------------<br><br>Guy Harris guy at <a href="http://alum.mit.edu">alum.mit.edu</a><br>Mon May 26 20:00:05 GMT 2008<br><br>Previous message: [Winpcap-users] pcap_list_datalinks() - how to free<br>

Next message: [Winpcap-users] Wincap and fake packages<br>Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]<br><br>________________________________<br><br>Gianluca Varenni wrote:<br><br>&gt; In the next days I will try to commit an implementation of <br>

&gt; pcap_free_datalinks() in the libpcap source tree.<br><br>I&#39;ve checked one into the main and 1.0 branches (along with a man page).<br><br><br>----- Original Message ----- <br>From: &quot;Esmond Pitt&quot; &lt;esmond.pitt at <a href="http://bigpond.com" target="_blank">bigpond.com</a>&gt;<br>

To: &lt;winpcap-users at <a href="http://winpcap.org" target="_blank">winpcap.org</a>&gt;<br>Sent: Tuesday, May 20, 2008 11:35 PM<br>
Subject: [Winpcap-users] pcap_list_datalinks() - how to free<br><br><br>&gt; The documentation for the pcap_list_datalinks() function says that the <br>&gt; user<br>&gt; is responsible for freeing the array of integers allocated by the <br>


&gt; function.<br>&gt;<br>&gt; As no specific function to do that is provided, presumably we are supposed<br>&gt; to use free(3). But in a DLL environment this is of course most <br>&gt; problematic,<br>&gt; and indeed causes SEGVs when I do it.<br>


&gt;<br>&gt; I think you need to add a pcap_free_datalinks() function. Or is there some<br>&gt; other solution?<br><br>No other solution. This function was created within the linux/unix <br>environment, where it&#39;s safe to call malloc/free from across DLLs/shared <br>


object boundaries (while it&#39;s not under Windows with the MS CRT).<br><br>In the next days I will try to commit an implementation of <br>pcap_free_datalinks() in the libpcap source tree.<br><br>Have a nice day<br>GV<br>


<br>&gt;<br>&gt; EJP<br>&gt;<br>&gt; _______________________________________________<br>&gt; Winpcap-users mailing list<br>&gt; Winpcap-users at <a href="http://winpcap.org" target="_blank">winpcap.org</a><br>&gt; <a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a> <br>


</div>