Skip to content

Commit

Permalink
tests: test-qgraph: fix a memory leak
Browse files Browse the repository at this point in the history
Spotted by ASAN when 'make check'.

Signed-off-by: Li Qiang <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Fixes: fc281c8
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
terenceli authored and bonzini committed Mar 11, 2019
1 parent fcfd1bc commit 944b96c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test-qgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit 944b96c

Please sign in to comment.