tests: fix endianness-test leaks
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 27 Jan 2017 09:01:39 +0000 (13:01 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 28 Feb 2017 20:09:28 +0000 (00:09 +0400)
Spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
tests/endianness-test.c

index cf8d41b7b471c8f4d0d86ee2ccbf006bb5337cdd..ed0bf52019dcc5d2deb276461b5a049ca9c1b65a 100644 (file)
@@ -295,14 +295,17 @@ int main(int argc, char **argv)
         path = g_strdup_printf("endianness/%s",
                                test_cases[i].machine);
         qtest_add_data_func(path, &test_cases[i], test_endianness);
+        g_free(path);
 
         path = g_strdup_printf("endianness/split/%s",
                                test_cases[i].machine);
         qtest_add_data_func(path, &test_cases[i], test_endianness_split);
+        g_free(path);
 
         path = g_strdup_printf("endianness/combine/%s",
                                test_cases[i].machine);
         qtest_add_data_func(path, &test_cases[i], test_endianness_combine);
+        g_free(path);
     }
 
     return g_test_run();