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)
|
||||
{
|
||||
if (!addr) {
|
||||
return;
|
||||
}
|
||||
mlist_free(allocator, addr);
|
||||
if (allocator->opts & ALLOC_PARANOID) {
|
||||
mlist_check(allocator);
|
||||
|
Loading…
Reference in New Issue
Block a user