qemu-trivial
[Top][All Lists]
Advanced

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

[Qemu-trivial] [PATCH] numa: fix qerror_report_err not free issue


From: john.liuli
Subject: [Qemu-trivial] [PATCH] numa: fix qerror_report_err not free issue
Date: Sat, 30 Aug 2014 11:36:39 +0800

From: Li Liu <address@hidden>

All qerror_report_err returned none NULL pointers need to
be freed, otherwise will cause memory leaking.

Although this place did not cause real memory leaking by exit,
obviously it's not correct to use qerror_report_err
without error_free it.

Signed-off-by: Li Liu <address@hidden>
---
 numa.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/numa.c b/numa.c
index c78cec9..0b4ac9b 100644
--- a/numa.c
+++ b/numa.c
@@ -298,6 +298,7 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, 
Object *owner,
         MemoryRegion *seg = host_memory_backend_get_memory(backend, 
&local_err);
         if (local_err) {
             qerror_report_err(local_err);
+            error_free(local_err);
             exit(1);
         }
 
-- 
1.7.9.5





reply via email to

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