tests: fix memory leaks.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2019-02-24 13:34:41 +03:00
parent d6ed25d143
commit e1461bcfd3
3 changed files with 8 additions and 0 deletions

View File

@ -97,6 +97,8 @@ START_PARAMETRIZED_TEST (test_serialize, test_serialize_ds)
g_free (actual_result);
if (error != NULL)
g_error_free (error);
}
/* *INDENT-OFF* */
END_PARAMETRIZED_TEST

View File

@ -155,8 +155,12 @@ START_TEST (test_path_serialize)
/* when */
vpath = vfs_path_from_str_flags (ETALON_PATH_STR, VPF_USE_DEPRECATED_PARSER);
serialized_vpath = vfs_path_serialize (vpath, &error);
vfs_path_free (vpath);
if (error != NULL)
g_error_free (error);
/* then */
mctest_assert_ptr_ne (serialized_vpath, NULL);
mctest_assert_str_eq (serialized_vpath, ETALON_SERIALIZED_PATH);

View File

@ -128,6 +128,8 @@ parse_command_line (int *argc, char **argv[])
if (!g_option_context_parse (context, argc, argv, &error))
{
g_print ("option parsing failed: %s\n", error->message);
g_error_free (error);
return FALSE;
}