Check return codes
Static analysis finds these two places that we don't check error codes.
Check them.
Tested: Deprecated code. Inspection only.
Change-Id: I92c238c5a4b1f51c5c6855c59f4f943855c4e50f
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index f0b72fb..72e1c31 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -821,7 +821,11 @@
{
return -ERANGE;
}
- sd_bus_message_append_basic(m, argCode[0], doubleValue);
+ r = sd_bus_message_append_basic(m, argCode[0], doubleValue);
+ if (r < 0)
+ {
+ return r;
+ }
}
else if (argCode.starts_with("a"))
{
@@ -2373,7 +2377,11 @@
return;
}
- convertDBusToJSON("v", msg, propertyItem);
+ int r = convertDBusToJSON("v", msg, propertyItem);
+ if (r < 0)
+ {
+ BMCWEB_LOG_ERROR("Couldn't convert vector to json");
+ }
});
}
property = property->NextSiblingElement("property");