From: Clar Fon Date: Thu, 22 Aug 2019 21:48:42 +0000 (-0400) Subject: Allocate client_sock using calloc instead of malloc X-Git-Tag: v1.8.0~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=decb52f805549ddf060cc17a764d8d62ac7435be;p=thirdparty%2Frrdtool-1.x.git Allocate client_sock using calloc instead of malloc This ensures that wbuf_data, wbuf_size, and wbuf_capacity are all initialised to zero --- diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 521aedaa..5a7ed281 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -4125,7 +4125,7 @@ static void *listen_thread_main( continue; } - client_sock = (listen_socket_t *) malloc(sizeof(listen_socket_t)); + client_sock = (listen_socket_t *) calloc(1, sizeof(listen_socket_t)); if (client_sock == NULL) { RRDD_LOG(LOG_ERR, "listen_thread_main: malloc failed."); continue;