server: use scalloc() for sk_out allocation
authorJens Axboe <axboe@kernel.dk>
Thu, 22 Mar 2018 17:29:25 +0000 (11:29 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 22 Mar 2018 17:29:25 +0000 (11:29 -0600)
This informs valgrind that it's properly initialized.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
server.c

index 15dc2c4b38ba3e01682cf85401458caa2d0421d4..d3f69774165f8add2cab5d998989e31866ff173c 100644 (file)
--- a/server.c
+++ b/server.c
@@ -1359,7 +1359,7 @@ static int accept_loop(int listen_sk)
 
                dprint(FD_NET, "server: connect from %s\n", from);
 
-               sk_out = smalloc(sizeof(*sk_out));
+               sk_out = scalloc(1, sizeof(*sk_out));
                if (!sk_out) {
                        close(sk);
                        return -1;