mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
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
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue