From c974bd793685a3c820e3099b0417f8876cbaca96 Mon Sep 17 00:00:00 2001 From: Tatsuhiko Kubo Date: Wed, 12 Jun 2013 00:41:24 +0900 Subject: [PATCH] Valgrind: another complaint about uninitialized bytes. --- src/os/unix/ngx_channel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/os/unix/ngx_channel.c b/src/os/unix/ngx_channel.c index 29c69da40..536a9ed4b 100644 --- a/src/os/unix/ngx_channel.c +++ b/src/os/unix/ngx_channel.c @@ -34,6 +34,8 @@ ngx_write_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, msg.msg_control = (caddr_t) &cmsg; msg.msg_controllen = sizeof(cmsg); + ngx_memzero(&cmsg, sizeof(cmsg)); + cmsg.cm.cmsg_len = CMSG_LEN(sizeof(int)); cmsg.cm.cmsg_level = SOL_SOCKET; cmsg.cm.cmsg_type = SCM_RIGHTS;