mirror of https://github.com/xemu-project/xemu.git
libqos: Allow calling guest_free on NULL pointer
Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
ebe7d8b166
commit
28452758c4
|
@ -285,6 +285,9 @@ uint64_t guest_alloc(QGuestAllocator *allocator, size_t size)
|
||||||
|
|
||||||
void guest_free(QGuestAllocator *allocator, uint64_t addr)
|
void guest_free(QGuestAllocator *allocator, uint64_t addr)
|
||||||
{
|
{
|
||||||
|
if (!addr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mlist_free(allocator, addr);
|
mlist_free(allocator, addr);
|
||||||
if (allocator->opts & ALLOC_PARANOID) {
|
if (allocator->opts & ALLOC_PARANOID) {
|
||||||
mlist_check(allocator);
|
mlist_check(allocator);
|
||||||
|
|
Loading…
Reference in New Issue