From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNZU1-0000iG-7v for qemu-devel@nongnu.org; Fri, 29 Aug 2014 23:37:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNZTw-0002jP-DQ for qemu-devel@nongnu.org; Fri, 29 Aug 2014 23:37:45 -0400 From: "john.liuli" Date: Sat, 30 Aug 2014 11:36:39 +0800 Message-ID: <1409369799-9028-1-git-send-email-john.liuli@huawei.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] numa: fix qerror_report_err not free issue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mjt@tls.msk.ru Cc: qemu-trivial@nongnu.org, Li Liu , qemu-devel@nongnu.org From: Li Liu 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 --- 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