Enable init checker
clang-tidy added cppcoreguidelines-init-variables as a check, which is
something we already enforce to some extent, but getting CI to enforce
it will help reviews move faster.
Tested: Code compiles. Noop changes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I7e10950de617b1d3262265572b1703f2e60b69d0
diff --git a/include/ssl_key_handler.hpp b/include/ssl_key_handler.hpp
index abb1c94..eb59bee 100644
--- a/include/ssl_key_handler.hpp
+++ b/include/ssl_key_handler.hpp
@@ -256,8 +256,7 @@
{
std::cerr << "Generating x509 Certificate\n";
// Use this code to directly generate a certificate
- X509* x509;
- x509 = X509_new();
+ X509* x509 = X509_new();
if (x509 != nullptr)
{
// get a random number from the RNG for the certificate serial
@@ -280,8 +279,7 @@
X509_set_pubkey(x509, pPrivKey);
// get the subject name
- X509_NAME* name;
- name = X509_get_subject_name(x509);
+ X509_NAME* name = X509_get_subject_name(x509);
X509_NAME_add_entry_by_txt(
name, "C", MBSTRING_ASC,