diff options
Diffstat (limited to 'crypto/heimdal/lib/roken/freeaddrinfo.c')
-rw-r--r-- | crypto/heimdal/lib/roken/freeaddrinfo.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/crypto/heimdal/lib/roken/freeaddrinfo.c b/crypto/heimdal/lib/roken/freeaddrinfo.c index f963d15..56124e5 100644 --- a/crypto/heimdal/lib/roken/freeaddrinfo.c +++ b/crypto/heimdal/lib/roken/freeaddrinfo.c @@ -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. * @@ -33,7 +33,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$Id: freeaddrinfo.c,v 1.2 1999/12/03 04:10:06 assar Exp $"); +RCSID("$Id: freeaddrinfo.c,v 1.4 2001/05/11 09:10:32 joda Exp $"); #endif #include "roken.h" @@ -45,8 +45,13 @@ RCSID("$Id: freeaddrinfo.c,v 1.2 1999/12/03 04:10:06 assar Exp $"); 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); } } |