From a704c7f7f5d05dd0ae43312c50d0bb8bf9892067 Mon Sep 17 00:00:00 2001 From: yrutschle Date: Sat, 28 Aug 2021 16:03:58 +0200 Subject: [PATCH] fix #302 --- common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.c b/common.c index 909729ce..453e2711 100644 --- a/common.c +++ b/common.c @@ -188,7 +188,7 @@ int start_listen_sockets(struct listen_endpoint *sockfd[]) for (addr = start_addr; addr; addr = addr->ai_next) { num_addr++; - *sockfd = realloc(*sockfd, num_addr * sizeof(*sockfd)); + *sockfd = realloc(*sockfd, num_addr * sizeof(*sockfd[0])); (*sockfd)[num_addr-1].socketfd = listen_single_addr(addr, keepalive, udp); (*sockfd)[num_addr-1].type = udp ? SOCK_DGRAM : SOCK_STREAM; if (cfg.verbose)