diff options
author | neksard <neksard@yandex-team.ru> | 2022-02-10 16:45:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:23 +0300 |
commit | 8f7cf138264e0caa318144bf8a2c950e0b0a8593 (patch) | |
tree | 83bf5c8c8047c42d8475e6095df90ccdc3d1b57f /contrib/libs/c-ares/ares_free_hostent.c | |
parent | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (diff) | |
download | ydb-8f7cf138264e0caa318144bf8a2c950e0b0a8593.tar.gz |
Restoring authorship annotation for <neksard@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/c-ares/ares_free_hostent.c')
-rw-r--r-- | contrib/libs/c-ares/ares_free_hostent.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/contrib/libs/c-ares/ares_free_hostent.c b/contrib/libs/c-ares/ares_free_hostent.c index cfc5f81feb..29c82c6704 100644 --- a/contrib/libs/c-ares/ares_free_hostent.c +++ b/contrib/libs/c-ares/ares_free_hostent.c @@ -1,41 +1,41 @@ - -/* Copyright 1998 by the Massachusetts Institute of Technology. - * - * Permission to use, copy, modify, and distribute this - * software and its documentation for any purpose and without - * fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting - * documentation, and that the name of M.I.T. not be used in - * advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" - * without express or implied warranty. - */ - -#include "ares_setup.h" - -#ifdef HAVE_NETDB_H -#include <netdb.h> -#endif - -#include "ares.h" -#include "ares_private.h" /* for memdebug */ - -void ares_free_hostent(struct hostent *host) -{ - char **p; - - if (!host) - return; - + +/* Copyright 1998 by the Massachusetts Institute of Technology. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of M.I.T. not be used in + * advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" + * without express or implied warranty. + */ + +#include "ares_setup.h" + +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif + +#include "ares.h" +#include "ares_private.h" /* for memdebug */ + +void ares_free_hostent(struct hostent *host) +{ + char **p; + + if (!host) + return; + ares_free((char *)(host->h_name)); - for (p = host->h_aliases; *p; p++) + for (p = host->h_aliases; *p; p++) ares_free(*p); ares_free(host->h_aliases); ares_free(host->h_addr_list[0]); /* no matter if there is one or many entries, - there is only one malloc for all of them */ + there is only one malloc for all of them */ ares_free(host->h_addr_list); ares_free(host); -} +} |