Sha256: c40ec8c0c44ae82d1ac0f233fe50ed5bfdfba4ec92ebbb3e9bdc466c23d99b2c

Contents?: true

Size: 1.27 KB

Versions: 70

Compression:

Stored size: 1.27 KB

Contents

/* 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; p++)
    ares_free(*p);
  ares_free(host->h_aliases);
  if (host->h_addr_list) {
    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 */
    ares_free(host->h_addr_list);
  }
  ares_free(host);
}

Version data entries

70 entries across 70 versions & 2 rubygems

Version Path
grpc-1.67.0 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.67.0.pre1 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.66.0 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.66.0.pre5 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.66.0.pre3 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.58.3 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.59.5 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.60.2 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.61.3 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.62.3 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.63.2 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.64.3 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.65.2 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.65.1 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.65.0 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.65.0.pre2 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.65.0.pre1 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.63.0 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.62.0 third_party/cares/cares/src/lib/ares_free_hostent.c
grpc-1.62.0.pre1 third_party/cares/cares/src/lib/ares_free_hostent.c