Browse Source

numa: Fixed the memory leak of numa error message

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>
Message-Id: <51ba6d7d03.1546399191.git.yi.z.zhang@linux.intel.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
tags/v4.0.0-rc0
Zhang Yi 5 months ago
parent
commit
2920bd644e
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      numa.c

+ 1
- 0
numa.c View File

@@ -533,6 +533,7 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
533 533
             error_report("memory backend %s is used multiple times. Each "
534 534
                          "-numa option must use a different memdev value.",
535 535
                          path);
536
+            g_free(path);
536 537
             exit(1);
537 538
         }
538 539
 

Loading…
Cancel
Save