]> git.proxmox.com Git - mirror_qemu.git/commit - util/vhost-user-server.c
util/vhost-user-server: fix memory leak in vu_message_read()
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 24 Sep 2020 15:15:43 +0000 (16:15 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 23 Oct 2020 12:42:16 +0000 (13:42 +0100)
commit8c7f7cbca0eb49cc86333ef8fa8068abb400520e
treea5fd31d6e2ff366b20bcf06609a2bdb7b19512e2
parent47ba680466d83adfa8c58620d4f5855c0de1a144
util/vhost-user-server: fix memory leak in vu_message_read()

fds[] is leaked when qio_channel_readv_full() fails.

Use vmsg->fds[] instead of keeping a local fds[] array. Then we can
reuse goto fail to clean up fds. vmsg->fd_num must be zeroed before the
loop to make this safe.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20200924151549.913737-8-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
util/vhost-user-server.c