qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak
Date: Mon, 11 Mar 2019 11:09:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

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

Fixes: fc281c80202

> Signed-off-by: Li Qiang <address@hidden>

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]