qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 08/15] libqos: Allow calling guest_free on NULL point


From: Paolo Bonzini
Subject: [Qemu-devel] [PULL 08/15] libqos: Allow calling guest_free on NULL pointer
Date: Fri, 19 Jun 2015 09:45:29 +0200

From: Fam Zheng <address@hidden>

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 tests/libqos/malloc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c
index 8276130..82b9df5 100644
--- a/tests/libqos/malloc.c
+++ b/tests/libqos/malloc.c
@@ -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);
-- 
2.4.3





reply via email to

[Prev in Thread] Current Thread [Next in Thread]