[En-Nut-Discussion] HTTP  password protection
    Ulrich Hertlein 
    ulrich.hertlein at artcom.de
       
    Mon Aug 28 17:55:58 CEST 2006
    
    
  
Peter Sodermanns wrote:
> Edwin van den Oetelaar schrieb:
> 
>> Do I see this correctly ? You free auth and then you reference the
>> contents to find the next block.
> 
> Well, I believe you're right. One should walk through the list from end
> to start.
I think what Edwin meant was that you're reading 'auth->next' *after*
you've free'd 'auth' so the next pointer could be invalid or NULL.
AUTHINFO *auth = authList;
while (auth) {
    AUTHINFO * next = auth->next;
    NutHeapFree(auth);
    auth = next;
}
Locking those ops is another matter.
/ulrich
--
Ulrich Hertlein | Software Development
ART+COM AG
Kleiststr. 23-26 | 10787 Berlin | Germany
phone: +49.30.21001-433
fax:   +49.30.21001-555
http://www.artcom.de
    
    
More information about the En-Nut-Discussion
mailing list