]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - libares/ares_free_hostent.c
need automake as a build-dep, even though we don't use most of it
[1ts-debian.git] / libares / ares_free_hostent.c
1 /* Copyright 1998 by the Massachusetts Institute of Technology.
2  *
3  * Permission to use, copy, modify, and distribute this
4  * software and its documentation for any purpose and without
5  * fee is hereby granted, provided that the above copyright
6  * notice appear in all copies and that both that copyright
7  * notice and this permission notice appear in supporting
8  * documentation, and that the name of M.I.T. not be used in
9  * advertising or publicity pertaining to distribution of the
10  * software without specific, written prior permission.
11  * M.I.T. makes no representations about the suitability of
12  * this software for any purpose.  It is provided "as is"
13  * without express or implied warranty.
14  */
15
16 static const char rcsid[] = "$Id: ares_free_hostent.c,v 1.2 1998/09/22 01:46:38 ghudson Exp $";
17
18 #include <stdlib.h>
19 #include <netdb.h>
20 #include "ares.h"
21
22 void ares_free_hostent(struct hostent *host)
23 {
24   char **p;
25
26   free(host->h_name);
27   for (p = host->h_aliases; *p; p++)
28     free(*p);
29   free(host->h_aliases);
30   free(host->h_addr_list[0]);
31   free(host->h_addr_list);
32   free(host);
33 }