mem = malloc (1);
assert (mem != NULL);
free (mem);
+ /* cppcheck-suppress deallocuse */
*mem = 1;
}
}
assert (mem != NULL);
*mem = 1;
}
+ /* cppcheck-suppress memleak */
}
int
directory, strerror (errno));
free (directory);
assert_not_reached ();
+ return NULL;
}
free (templ);
printf ("# couldn't open file for writing: %s: %s\n", name, strerror (errno));
free (path);
assert_not_reached ();
+ return;
}
if (fwrite (contents, 1, length, f) != length ||
printf ("# couldn't write to file: %s: %s\n", name, strerror (errno));
free (path);
assert_not_reached ();
+ return;
}
free (path);
printf ("# Couldn't delete file: %s\n", name);
free (path);
assert_not_reached ();
+ return;
}
free (path);
if (strncmp (tokens[0], "pkcs11:", 7) == 0) {
if (server->provider) {
server->module = p11_kit_module_load (server->provider, 0);
- if (server->module == NULL)
+ if (server->module == NULL) {
+ free (server);
return NULL;
+ }
}
} else {
server->module = p11_kit_module_load (tokens[0], 0);
- if (server->module == NULL)
+ if (server->module == NULL) {
+ free (server);
return NULL;
+ }
}
#endif /* OS_WIN32 */
ret = p11_extract_pem_directory_hash (&test.ex, test.directory);
assert_num_eq (true, ret);
- test_check_directory (test.directory, ("Cacert3_Here.pem", "Cacert3_Here.1.pem",
#ifdef OS_UNIX
- "e5662767.1", "e5662767.0", "590d426f.1", "590d426f.0",
+ test_check_directory (test.directory, ("Cacert3_Here.pem", "Cacert3_Here.1.pem",
+ "e5662767.1", "e5662767.0", "590d426f.1", "590d426f.0",
+ NULL));
+#else
+ test_check_directory (test.directory, ("Cacert3_Here.pem", "Cacert3_Here.1.pem",
+ NULL));
#endif
- NULL));
test_check_file (test.directory, "Cacert3_Here.pem", SRCDIR "/trust/fixtures/cacert3.pem");
test_check_file (test.directory, "Cacert3_Here.1.pem", SRCDIR "/trust/fixtures/cacert3.pem");
#ifdef OS_UNIX
ret = p11_extract_openssl_directory (&test.ex, test.directory);
assert_num_eq (true, ret);
- test_check_directory (test.directory, ("Custom_Label.pem", "Custom_Label.1.pem",
#ifdef OS_UNIX
- "e5662767.1", "e5662767.0", "590d426f.1", "590d426f.0",
+ test_check_directory (test.directory, ("Custom_Label.pem", "Custom_Label.1.pem",
+ "e5662767.1", "e5662767.0", "590d426f.1", "590d426f.0",
+ NULL));
+#else
+ test_check_directory (test.directory, ("Custom_Label.pem", "Custom_Label.1.pem",
+ NULL));
#endif
- NULL));
test_check_file (test.directory, "Custom_Label.pem",
SRCDIR "/trust/fixtures/cacert3-trusted-server-alias.pem");
test_check_file (test.directory, "Custom_Label.1.pem",
ret = p11_save_finish_directory (dir, true);
assert_num_eq (true, ret);
- test_check_directory (subdir, ("blah.cer", "file.txt",
#ifdef OS_UNIX
+ test_check_directory (subdir, ("blah.cer", "file.txt",
"link.ext",
-#endif
NULL));
+#else
+ test_check_directory (subdir, ("blah.cer", "file.txt",
+ NULL));
+#endif
test_check_file (subdir, "blah.cer", SRCDIR "/trust/fixtures/cacert3.der");
test_check_data (subdir, "file.txt", test_text, strlen (test_text));
#ifdef OS_UNIX
ret = p11_save_finish_directory (dir, true);
assert_num_eq (true, ret);
- test_check_directory (subdir, ("file.txt", "file.1.txt", "file.2.txt",
- "no-ext", "no-ext.1",
- "with-num.0", "with-num.1",
#ifdef OS_UNIX
- "link.0", "link.1",
+ test_check_directory (subdir, ("file.txt", "file.1.txt", "file.2.txt",
+ "no-ext", "no-ext.1",
+ "with-num.0", "with-num.1",
+ "link.0", "link.1",
+ NULL));
+#else
+ test_check_directory (subdir, ("file.txt", "file.1.txt", "file.2.txt",
+ "no-ext", "no-ext.1",
+ "with-num.0", "with-num.1",
+ NULL));
#endif
- NULL));
test_check_data (subdir, "file.txt", test_text, 5);
test_check_data (subdir, "file.1.txt", test_text, 10);
test_check_data (subdir, "file.2.txt", test_text, 15);
va_start (va, file);
while (file != NULL) {
- if (!p11_dict_set (files, (void *)file, (void *)file))
+ if (!p11_dict_set (files, (void *)file, (void *)file)) {
+ va_end (va);
return_val_if_reached (NULL);
+ }
file = va_arg (va, const char *);
}