tests: fix two dangling-reference warnings with gcc 13

Change-Id: Iccb9045eaa468f4af7782dc466bd8a28a53ffa73
diff --git a/tests/security/test-certificate-store.cpp b/tests/security/test-certificate-store.cpp
index b0580c9..efd7ace 100644
--- a/tests/security/test-certificate-store.cpp
+++ b/tests/security/test-certificate-store.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  The University of Memphis,
+ * Copyright (c) 2014-2023,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -68,7 +68,7 @@
     // Create certificate and load it to the validator
     // previously this was done by in nlsr ctor
     for (const auto& id : {rootId, siteIdentity, opIdentity, routerId}) {
-      const auto& cert = id.getDefaultKey().getDefaultCertificate();
+      auto cert = id.getDefaultKey().getDefaultCertificate();
       conf.loadCertToValidator(cert);
       certStore.insert(cert);
     }
diff --git a/tests/test-lsa-rule.cpp b/tests/test-lsa-rule.cpp
index e5e6823..cf9c699 100644
--- a/tests/test-lsa-rule.cpp
+++ b/tests/test-lsa-rule.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  The University of Memphis,
+ * Copyright (c) 2014-2023,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -63,8 +63,7 @@
     saveIdentityCert(rootId, ROOT_CERT_PATH.string());
 
     for (const auto& id : {rootId, siteIdentity, opIdentity, routerId}) {
-      const auto& cert = id.getDefaultKey().getDefaultCertificate();
-      confParam.loadCertToValidator(cert);
+      confParam.loadCertToValidator(id.getDefaultKey().getDefaultCertificate());
     }
 
     // Loading the security section's validator part into the validator