return 0;
if(do_auto) {
- ub_sock = malloc(sizeof(struct unbound_socket));
+ ub_sock = calloc(1, sizeof(struct unbound_socket));
if(!ub_sock)
return 0;
if((s = make_sock_port(SOCK_DGRAM, ifname, port, hints, 1,
return 0;
}
} else if(do_udp) {
- ub_sock = malloc(sizeof(struct unbound_socket));
+ ub_sock = calloc(1, sizeof(struct unbound_socket));
if(!ub_sock)
return 0;
/* regular udp socket */
int is_ssl = if_is_ssl(ifname, port, ssl_port,
tls_additional_port);
enum listen_type port_type;
- ub_sock = malloc(sizeof(struct unbound_socket));
+ ub_sock = calloc(1, sizeof(struct unbound_socket));
if(!ub_sock)
return 0;
if(is_ssl)
if(list->fd != -1) {
sock_close(list->fd);
}
- free(list->socket->addr);
+ freeaddrinfo(list->socket->addr);
free(list->socket);
free(list);
list = nx;