Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
char *buf, size_t buflen,
struct hostent **hedstp)
{
- struct nwrap_vector *addr_list = malloc(sizeof(struct nwrap_vector));
+ struct nwrap_vector *addr_list = NULL;
union {
char *ptr;
char **list;
(void) b; /* unused */
(void) af; /* unused */
+ addr_list = calloc(1, sizeof(struct nwrap_vector));
if (addr_list == NULL) {
NWRAP_LOG(NWRAP_LOG_ERROR,
"Unable to allocate memory for address list");
return -1;
}
- ZERO_STRUCTP(addr_list);
-
rc = nwrap_files_internal_gethostbyname(name, AF_UNSPEC, hedst,
addr_list);
if (rc == -1) {