[Qemu-devel] [PATCH V8 1/5] numa: Fixed the memory leak of numa error message

Zhang Yi posted 5 patches 6 years, 10 months ago
There is a newer version of this series
[Qemu-devel] [PATCH V8 1/5] numa: Fixed the memory leak of numa error message
Posted by Zhang Yi 6 years, 10 months ago
object_get_canonical_path_component() returns a string which
must be freed using g_free().

Signed-off-by: Zhang Yi <yi.z.zhang@linux.intel.com>
Reviewed-by: Pankaj gupta <pagupta@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
---
 numa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/numa.c b/numa.c
index 50ec016..3875e1e 100644
--- a/numa.c
+++ b/numa.c
@@ -533,6 +533,7 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
             error_report("memory backend %s is used multiple times. Each "
                          "-numa option must use a different memdev value.",
                          path);
+            g_free(path);
             exit(1);
         }
 
-- 
2.7.4


Re: [Qemu-devel] [PATCH V8 1/5] numa: Fixed the memory leak of numa error message
Posted by Eduardo Habkost 6 years, 9 months ago
On Wed, Jan 02, 2019 at 01:25:56PM +0800, Zhang Yi wrote:
> object_get_canonical_path_component() returns a string which
> must be freed using g_free().
> 
> Signed-off-by: Zhang Yi <yi.z.zhang@linux.intel.com>
> Reviewed-by: Pankaj gupta <pagupta@redhat.com>
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>

Queued, thanks.

-- 
Eduardo