(freeaddrinfo): also free every `struct addrinfo'. from
<tmartin@mirapoint.com> git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9863 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1999 - 2001 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -45,8 +45,13 @@ RCSID("$Id$");
|
||||
void
|
||||
freeaddrinfo(struct addrinfo *ai)
|
||||
{
|
||||
for (; ai != NULL; ai = ai->ai_next) {
|
||||
struct addrinfo *tofree;
|
||||
|
||||
while(ai != NULL) {
|
||||
free (ai->ai_canonname);
|
||||
free (ai->ai_addr);
|
||||
tofree = ai;
|
||||
ai = ai->ai-next;
|
||||
free (tofree);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user