rpc: Fix crash on error paths of message dispatching
rpc: Fix crash on error paths of message dispatching

This patch resolves CVE-2013-0170:
https://bugzilla.redhat.com/show_bug.cgi?id=893450

When reading and dispatching of a message failed the message was freed
but wasn't removed from the message queue.

After that when the connection was about to be closed the pointer for
the message was still present in the queue and it was passed to
virNetMessageFree which tried to call the callback function from an
uninitialized pointer.

This patch removes the message from the queue before it's freed.

* rpc/virnetserverclient.c: virNetServerClientDispatchRead:
    - avoid use after free of RPC messages

zhlcindy/libvirt-1.1.4-maintain,zippy2/libvirt,rlaager/libvirt,taget/libvirt,olafhering/libvirt,iam-TJ/libvirt,siboulet/libvirt-openvz,iam-TJ/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,shugaoye/libvirt,cbosdo/libvirt,zhlcindy/libvirt-1.1.4-maintain,iam-TJ/libvirt,siboulet/libvirt-openvz,olafhering/libvirt,eskultety/libvirt,fabianfreyer/libvirt,agx/libvirt,eskultety/libvirt,jfehlig/libvirt,zhlcindy/libvirt-1.1.4-maintain,fabianfreyer/libvirt,zippy2/libvirt,nertpinx/libvirt,trainstack/libvirt,iam-TJ/libvirt,iam-TJ/libvirt,andreabolognani/libvirt,trainstack/libvirt,rlaager/libvirt,cbosdo/libvirt,andreabolognani/libvirt,eskultety/libvirt,andreabolognani/libvirt,iam-TJ/libvirt,libvirt/libvirt,zippy2/libvirt,fabianfreyer/libvirt,trainstack/libvirt,libvirt/libvirt,libvirt/libvirt,jardasgit/libvirt,elmarco/libvirt,zippy2/libvirt,taget/libvirt,eskultety/libvirt,datto/libvirt,nertpinx/libvirt,crobinso/libvirt,VenkatDatta/libvirt,taget/libvirt,zhlcindy/libvirt-1.1.4-maintain,jfehlig/libvirt,jardasgit/libvirt,taget/libvirt,siboulet/libvirt-openvz,nertpinx/libvirt,rlaager/libvirt,siboulet/libvirt-openvz,jardasgit/libvirt,siboulet/libvirt-openvz,elmarco/libvirt,zhlcindy/libvirt-1.1.4-maintain,agx/libvirt,shugaoye/libvirt,elmarco/libvirt,trainstack/libvirt,datto/libvirt,cbosdo/libvirt,nertpinx/libvirt,datto/libvirt,iam-TJ/libvirt,datto/libvirt,crobinso/libvirt,olafhering/libvirt,shugaoye/libvirt,trainstack/libvirt,agx/libvirt,trainstack/libvirt,eskultety/libvirt,jardasgit/libvirt,VenkatDatta/libvirt,rlaager/libvirt,shugaoye/libvirt,olafhering/libvirt,jfehlig/libvirt,VenkatDatta/libvirt,fabianfreyer/libvirt,libvirt/libvirt,andreabolognani/libvirt,crobinso/libvirt,agx/libvirt,taget/libvirt,elmarco/libvirt,VenkatDatta/libvirt,jfehlig/libvirt,datto/libvirt,VenkatDatta/libvirt,rlaager/libvirt,jardasgit/libvirt,trainstack/libvirt,elmarco/libvirt,cbosdo/libvirt,cbosdo/libvirt,shugaoye/libvirt,nertpinx/libvirt,agx/libvirt,crobinso/libvirt