Fix some warning and leaks in api test code.

This commit is contained in:
Milan Broz
2017-10-28 11:59:06 +02:00
parent b78bd4ccce
commit 6e3622e0f1
3 changed files with 17 additions and 7 deletions

View File

@@ -259,8 +259,10 @@ static void _cleanup(void)
_system("rm -f " IMAGE1, 0);
_system("rm -rf " CONV_DIR, 0);
remove(test_loop_file);
remove(tmp_file_1);
if (test_loop_file)
remove(test_loop_file);
if (tmp_file_1)
remove(tmp_file_1);
remove(VALID_LUKS2_HEADER);
remove(REQS_LUKS2_HEADER);