Valgrind: fix "definitely lost" memory in test - test-resolve-file-path

==91379== 19 bytes in 1 blocks are definitely lost in loss record 2 of 9
==91379==    at 0x4843828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==91379==    by 0x48D1948: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==91379==    by 0x48ED5B0: g_strconcat (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==91379==    by 0x48B845F: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==91379==    by 0x48B869E: g_dir_make_tmp (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==91379==    by 0x10935E: main (test-resolve-file-path.c:71)
This commit is contained in:
Richard Cohen 2023-07-05 16:42:45 +01:00
parent 69df6ea57d
commit 378dc40585

View File

@ -65,7 +65,7 @@ main(int argc, char **argv)
* used to pass invalid home directories manually. The
* test error messages should then show the system's temporary
* directory to be used instead */
home_dir = argv[1];
home_dir = g_strdup (argv[1]);
else
/* Set up a fake home directory to play with */
home_dir = g_dir_make_tmp("gnucashXXXXXX", NULL);
@ -105,6 +105,7 @@ main(int argc, char **argv)
g_free(daout);
}
g_free (home_dir);
print_test_results();
return get_rv();
}