]> git.ipfire.org Git - thirdparty/libvirt.git/commit
remote: fix double free of migration params on error
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 22 Dec 2022 17:17:15 +0000 (12:17 -0500)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 10 Jan 2023 13:26:27 +0000 (08:26 -0500)
commit2b5f9251129d61cfc6cffa63d367af27850602a4
tree2e808527efde3dadc4e939f6b3e564ac77424a86
parent0edf44664e9f2f75c7ba5faab91e2e190b5626af
remote: fix double free of migration params on error

The remote_*_args methods will generally borrow pointers
passed in the caller, so should not be freed.

On failure of the virTypedParamsSerialize method, however,
xdr_free was being called. This is presumably because it
was thought that the params may have been partially
serialized and need cleaning up. This is incorrect, as
virTypedParamsSerialize takes care to cleanup partially
serialized data. This xdr_free call would lead to free'ing
the borrowed cookie pointers, which would be a double free.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/remote/remote_driver.c