All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak
@ 2019-03-10 16:02 Li Qiang
  2019-03-11  8:48 ` Thomas Huth
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Li Qiang @ 2019-03-10 16:02 UTC (permalink / raw)
  To: pbonzini, e.emanuelegiuseppe; +Cc: qemu-devel, liq3ea, Li Qiang

Spotted by ASAN when 'make check'.

Signed-off-by: Li Qiang <liq3ea@163.com>
---
 tests/test-qgraph.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/test-qgraph.c b/tests/test-qgraph.c
index f6a6565e31..5c7e457075 100644
--- a/tests/test-qgraph.c
+++ b/tests/test-qgraph.c
@@ -122,7 +122,7 @@ static void check_driver(const char *driver)
 static void check_test(const char *test, const char *interface)
 {
     QOSGraphEdge *edge;
-    const char *full_name = g_strdup_printf("%s-tests/%s", interface, test);
+    char *full_name = g_strdup_printf("%s-tests/%s", interface, test);
 
     qos_add_test(test, interface, testfunct, NULL);
     g_assert_cmpint(qos_graph_has_machine(test), ==, FALSE);
@@ -138,6 +138,7 @@ static void check_test(const char *test, const char *interface)
     g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, TRUE);
     qos_graph_node_set_availability(full_name, FALSE);
     g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, FALSE);
+    g_free(full_name);
 }
 
 static void count_each_test(QOSGraphNode *path, int len)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak
  2019-03-10 16:02 [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak Li Qiang
@ 2019-03-11  8:48 ` Thomas Huth
  2019-03-11 10:09 ` Philippe Mathieu-Daudé
  2019-03-11 15:33 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2019-03-11  8:48 UTC (permalink / raw)
  To: Li Qiang, pbonzini, e.emanuelegiuseppe; +Cc: liq3ea, qemu-devel

On 10/03/2019 17.02, Li Qiang wrote:
> Spotted by ASAN when 'make check'.
> 
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  tests/test-qgraph.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/test-qgraph.c b/tests/test-qgraph.c
> index f6a6565e31..5c7e457075 100644
> --- a/tests/test-qgraph.c
> +++ b/tests/test-qgraph.c
> @@ -122,7 +122,7 @@ static void check_driver(const char *driver)
>  static void check_test(const char *test, const char *interface)
>  {
>      QOSGraphEdge *edge;
> -    const char *full_name = g_strdup_printf("%s-tests/%s", interface, test);
> +    char *full_name = g_strdup_printf("%s-tests/%s", interface, test);
>  
>      qos_add_test(test, interface, testfunct, NULL);
>      g_assert_cmpint(qos_graph_has_machine(test), ==, FALSE);
> @@ -138,6 +138,7 @@ static void check_test(const char *test, const char *interface)
>      g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, TRUE);
>      qos_graph_node_set_availability(full_name, FALSE);
>      g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, FALSE);
> +    g_free(full_name);
>  }
>  
>  static void count_each_test(QOSGraphNode *path, int len)
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak
  2019-03-10 16:02 [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak Li Qiang
  2019-03-11  8:48 ` Thomas Huth
@ 2019-03-11 10:09 ` Philippe Mathieu-Daudé
  2019-03-11 15:33 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-03-11 10:09 UTC (permalink / raw)
  To: Li Qiang, pbonzini, e.emanuelegiuseppe; +Cc: liq3ea, qemu-devel

On 3/10/19 5:02 PM, Li Qiang wrote:
> Spotted by ASAN when 'make check'.
> 

Fixes: fc281c80202

> Signed-off-by: Li Qiang <liq3ea@163.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  tests/test-qgraph.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/test-qgraph.c b/tests/test-qgraph.c
> index f6a6565e31..5c7e457075 100644
> --- a/tests/test-qgraph.c
> +++ b/tests/test-qgraph.c
> @@ -122,7 +122,7 @@ static void check_driver(const char *driver)
>  static void check_test(const char *test, const char *interface)
>  {
>      QOSGraphEdge *edge;
> -    const char *full_name = g_strdup_printf("%s-tests/%s", interface, test);
> +    char *full_name = g_strdup_printf("%s-tests/%s", interface, test);
>  
>      qos_add_test(test, interface, testfunct, NULL);
>      g_assert_cmpint(qos_graph_has_machine(test), ==, FALSE);
> @@ -138,6 +138,7 @@ static void check_test(const char *test, const char *interface)
>      g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, TRUE);
>      qos_graph_node_set_availability(full_name, FALSE);
>      g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, FALSE);
> +    g_free(full_name);
>  }
>  
>  static void count_each_test(QOSGraphNode *path, int len)
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak
  2019-03-10 16:02 [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak Li Qiang
  2019-03-11  8:48 ` Thomas Huth
  2019-03-11 10:09 ` Philippe Mathieu-Daudé
@ 2019-03-11 15:33 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2019-03-11 15:33 UTC (permalink / raw)
  To: Li Qiang, e.emanuelegiuseppe; +Cc: qemu-devel, liq3ea

On 10/03/19 17:02, Li Qiang wrote:
> Spotted by ASAN when 'make check'.
> 
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  tests/test-qgraph.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/test-qgraph.c b/tests/test-qgraph.c
> index f6a6565e31..5c7e457075 100644
> --- a/tests/test-qgraph.c
> +++ b/tests/test-qgraph.c
> @@ -122,7 +122,7 @@ static void check_driver(const char *driver)
>  static void check_test(const char *test, const char *interface)
>  {
>      QOSGraphEdge *edge;
> -    const char *full_name = g_strdup_printf("%s-tests/%s", interface, test);
> +    char *full_name = g_strdup_printf("%s-tests/%s", interface, test);
>  
>      qos_add_test(test, interface, testfunct, NULL);
>      g_assert_cmpint(qos_graph_has_machine(test), ==, FALSE);
> @@ -138,6 +138,7 @@ static void check_test(const char *test, const char *interface)
>      g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, TRUE);
>      qos_graph_node_set_availability(full_name, FALSE);
>      g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, FALSE);
> +    g_free(full_name);
>  }
>  
>  static void count_each_test(QOSGraphNode *path, int len)
> 

Queued, thanks.

Paolo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-11 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-10 16:02 [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak Li Qiang
2019-03-11  8:48 ` Thomas Huth
2019-03-11 10:09 ` Philippe Mathieu-Daudé
2019-03-11 15:33 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.