]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-balloon: Don't mismatch g_malloc()/free (CID 1399146)
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 6 Mar 2019 03:05:59 +0000 (14:05 +1100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 30 Jul 2019 17:34:38 +0000 (12:34 -0500)
commit80c96a7b604d5f3816d857d4d108518895c1db2b
treeba58889952d602c3c927aecef75c1f336f28aec3
parent118112024d75559103b7d8c3b7c020da894f15c5
virtio-balloon: Don't mismatch g_malloc()/free (CID 1399146)

ed48c59875b6 "virtio-balloon: Safely handle BALLOON_PAGE_SIZE < host
page size" introduced a new temporary data structure which tracks 4kiB
chunks which have been inserted into the balloon by the guest but
don't yet form a full host page which we can discard.

Unfortunately, I had a thinko and allocated that structure with
g_malloc0() but freed it with a plain free() rather than g_free().
This corrects the problem.

Fixes: ed48c59875b6
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20190306030601.21986-2-david@gibson.dropbear.id.au>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
(cherry picked from commit 301cf2a8dd5024aa5bbdc6bd3e121174bbfc2957)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/virtio/virtio-balloon.c