aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/tran_sock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tran_sock.c b/lib/tran_sock.c
index 7834a77..3ad1222 100644
--- a/lib/tran_sock.c
+++ b/lib/tran_sock.c
@@ -661,6 +661,8 @@ get_request_sock(lm_ctx_t *lm_ctx, struct vfio_user_header *hdr,
msg.msg_controllen = CMSG_SPACE(sizeof(int) * *nr_fds);
msg.msg_control = alloca(msg.msg_controllen);
+ *nr_fds = 0;
+
/*
* TODO ideally we should set O_NONBLOCK on the fd so that the syscall is
* faster (?). I tried that and get short reads, so we need to store the