]> xenbits.xensource.com Git - libvirt.git/commit
rpc: Don't rewrite msg->fds on every read dispatch
authorBen Gray <ben.r.gray@gmail.com>
Thu, 26 Nov 2015 16:10:40 +0000 (16:10 +0000)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 12 Jan 2016 07:56:50 +0000 (08:56 +0100)
commit133c511b5275cfd0a024fe0c62467f494dc62e40
tree874520e85d2ccb1d91eb07ab946eac12922260cd
parent545e5571f9bafc61c65b563ca69907f8cc935f72
rpc: Don't rewrite msg->fds on every read dispatch

When we are receiving data in smaller chunks it might happen that
virNetServerClientDispatchRead() will be called multiple times.  And as
that happens, if it is a message that also transfer headers, we decode
the number of them every single time and, unfortunately, also allocate
the memory for them.  That causes a leak, in the best scenario.

Best viewed with '-w'.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/rpc/virnetserverclient.c