]> git.ipfire.org Git - thirdparty/libvirt.git/commit
client: fix memory leak in client msg
authorHao Wang <wanghao232@huawei.com>
Sat, 18 Jul 2020 07:43:30 +0000 (15:43 +0800)
committerJán Tomko <jtomko@redhat.com>
Wed, 9 Sep 2020 13:03:45 +0000 (15:03 +0200)
commit0011ec3191a5bffff14fc2c53fbdf457a805cfb1
tree2bfc70ee687d49ce6680d4a9f1f94ae35adbea36
parentc43622f06e295edcb9cedf33583f0bd18fb04b10
client: fix memory leak in client msg

When closing client->waitDispatch in virNetClientIOEventLoopRemoveAll
or virNetClientIOEventLoopRemoveDone, VIR_FREE() is called to free
call->msg directly, resulting in leak of the memory call->msg->buffer
points to.
Use virNetMessageFree(call->msg) instead of VIR_FREE(call->msg).

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/rpc/virnetclient.c