diff mbox series

[V5_resend,1/7] numa: Fixed the memory leak of numa error message

Message ID 4773dd7667ce53e3894ac705badd6e580808c6ce.1542699775.git.yi.z.zhang@linux.intel.com
State New
Headers show
Series nvdimm: support MAP_SYNC for memory-backend-file | expand

Commit Message

Zhang, Yi Nov. 20, 2018, 7:48 a.m. UTC
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>
---
 numa.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Igor Mammedov Nov. 26, 2018, 1:10 p.m. UTC | #1
On Tue, 20 Nov 2018 15:48:06 +0800
Zhang Yi <yi.z.zhang@linux.intel.com> 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: 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);
>          }
>
Pankaj Gupta Nov. 29, 2018, 8:41 a.m. UTC | #2
> 
> 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>
> ---
>  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);
>          }
>  
> --

Reviewed-by: Pankaj gupta <pagupta@redhat.com>

> 2.7.4
diff mbox series

Patch

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);
         }