diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index 27a9e3d..ab35bb2 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -731,6 +731,11 @@
             std::string containedType = argCode.substr(1, argCode.size() - 1);
             r = sd_bus_message_open_container(m, SD_BUS_TYPE_STRUCT,
                                               containedType.c_str());
+            if (r < 0)
+            {
+                return r;
+            }
+
             nlohmann::json::const_iterator it = j->begin();
             for (const std::string &argCode : dbusArgSplit(arg_type))
             {
@@ -753,6 +758,11 @@
             std::string containedType = argCode.substr(1, argCode.size() - 1);
             r = sd_bus_message_open_container(m, SD_BUS_TYPE_DICT_ENTRY,
                                               containedType.c_str());
+            if (r < 0)
+            {
+                return r;
+            }
+
             std::vector<std::string> codes = dbusArgSplit(containedType);
             if (codes.size() != 2)
             {
@@ -2224,9 +2234,6 @@
                             }
                             else
                             {
-                                tinyxml2::XMLElement *node =
-                                    pRoot->FirstChildElement("node");
-
                                 // if we know we're the only call, build the
                                 // json directly
                                 tinyxml2::XMLElement *interface =
diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp
index 643c804..7f2a33c 100644
--- a/include/pam_authenticate.hpp
+++ b/include/pam_authenticate.hpp
@@ -14,13 +14,24 @@
     {
         return PAM_AUTH_ERR;
     }
-    auto* pass = reinterpret_cast<char*>(
-        malloc(std::strlen(reinterpret_cast<char*>(appdataPtr)) + 1));
-    std::strcpy(pass, reinterpret_cast<char*>(appdataPtr));
+    char* appPass = reinterpret_cast<char*>(appdataPtr);
+    size_t appPassSize = std::strlen(appPass);
+    char* pass = reinterpret_cast<char*>(malloc(appPassSize + 1));
+    if (!pass)
+    {
+        return PAM_AUTH_ERR;
+    }
+
+    std::strcpy(pass, appPass);
 
     *resp = reinterpret_cast<pam_response*>(
         calloc(numMsg, sizeof(struct pam_response)));
 
+    if (resp == NULL)
+    {
+        return PAM_AUTH_ERR;
+    }
+
     for (int i = 0; i < numMsg; ++i)
     {
         /* Ignore all PAM messages except prompting for hidden input */
