<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Did you also check that you aren't calling CDevice::Cleanup
multiple times on the same "devs" pointer (thus trying to free the adapters list
multiple times)?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Have a nice day</FONT></DIV>
<DIV><FONT size=2>GV</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=nightskywriter@gmail.com href="mailto:nightskywriter@gmail.com">Eric
Hansen</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">WinPCap Mailing List</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, November 13, 2005 4:04
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users]
pcap_freealldevs() causing program crash.</DIV>
<DIV><BR></DIV>Does anyone know why, whenever I put in
"pcap_freealldevs(devs);" into my cleanup code (that frees all the memory,
etc...that my program uses), it always crashes?<BR><BR>devs
declaration:<BR>pcap_if_t *devs, *d; // Device list<BR><BR>My cleanup
code:<BR>void CDevice::Cleanup(){<BR><BR> // Free the device
list<BR> pcap_freealldevs(devs);<BR>}<BR><BR>and how I'm
using devs:<BR>void CDevice::Devices(){<BR>
if(pcap_findalldevs(&devs, error) == -1){<BR>
AfxMessageBox(error);<BR> }
else{<BR> for(iCount = 0, d = devs; d !=
NULL; d = d->next, iCount++){<BR>
if(d->description){<BR>
cDescription[iCount]
= d->description;<BR>
}<BR><BR>
cDevice[iCount] = d->name;<BR>
}<BR>
}<BR>}<BR><BR>I've been racking my brain for over an hour
trying to figure out what I'm doing.<BR><BR>(Note: I call Cleanup() in the
WM_DESTROY Windows message)<BR>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE></BODY></HTML>