diff options
author | Ed Tanous <ed@tanous.net> | 2024-05-07 01:41:30 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-05-09 02:32:22 +0300 |
commit | 0790081778658c5797dd24fd811ba407d6fadae6 (patch) | |
tree | 03002ec5a181e7b475c01b5f7237556588174aeb /include | |
parent | e5cf777eb93bc434e86483ac210e7a55a509a245 (diff) | |
download | bmcweb-0790081778658c5797dd24fd811ba407d6fadae6.tar.xz |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/openbmc_dbus_rest.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp index f0b72fbcc4..72e1c31c06 100644 --- a/include/openbmc_dbus_rest.hpp +++ b/include/openbmc_dbus_rest.hpp @@ -821,7 +821,11 @@ inline int convertJsonToDbus(sd_bus_message* m, const std::string& argType, { 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 @@ inline void 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"); |