Commit 28452758 authored by Fam Zheng's avatar Fam Zheng Committed by Paolo Bonzini
Browse files

libqos: Allow calling guest_free on NULL pointer



Signed-off-by: default avatarFam Zheng <famz@redhat.com>
Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent ebe7d8b1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -285,6 +285,9 @@ uint64_t guest_alloc(QGuestAllocator *allocator, size_t size)

void guest_free(QGuestAllocator *allocator, uint64_t addr)
{
    if (!addr) {
        return;
    }
    mlist_free(allocator, addr);
    if (allocator->opts & ALLOC_PARANOID) {
        mlist_check(allocator);