summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2021-01-11 15:36:11 +0100
committerVolker Lendecke <vl@samba.org>2021-01-14 13:29:35 +0000
commitcc9ade9b0a5a52cb468976b51dffbfad73ef5118 (patch)
tree5fcadd102bffad97377a065da23771acefeb6ba3 /source3
parent834f9e152e5f81bd8d128bd627fce3b83d3ebb0b (diff)
downloadsamba-cc9ade9b0a5a52cb468976b51dffbfad73ef5118.tar.gz
lib: Initialize variables in prefork_listen_accept_handler()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/server_prefork.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/lib/server_prefork.c b/source3/lib/server_prefork.c
index 344bff0efa2..2fb13c90fee 100644
--- a/source3/lib/server_prefork.c
+++ b/source3/lib/server_prefork.c
@@ -587,8 +587,8 @@ static void prefork_listen_accept_handler(struct tevent_context *ev,
struct tevent_req *req = ctx->req;
struct pf_listen_state *state = tevent_req_data(
ctx->req, struct pf_listen_state);
- struct sockaddr_storage addr;
- socklen_t addrlen;
+ struct sockaddr_storage addr = { .ss_family = 0 };
+ socklen_t addrlen = sizeof(addr);
int soerr = 0;
socklen_t solen = sizeof(soerr);
int sd = -1;
@@ -616,8 +616,6 @@ static void prefork_listen_accept_handler(struct tevent_context *ev,
goto done;
}
- ZERO_STRUCT(addr);
- addrlen = sizeof(addr);
sd = accept(ctx->listen_fd, (struct sockaddr *)&addr, &addrlen);
if (sd == -1) {
state->error = errno;