Remove use after free in error handling path
Change-Id: I04476b016584f1d19af035ae51e0c04076b4de0b
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index aec1ebe..7258d1d 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -2752,7 +2752,8 @@
if (pathIt == sensors::paths.cend())
{
BMCWEB_LOG_ERROR("Wrong node provided : {}", node);
- mapComplete(boost::beast::http::status::bad_request, {});
+ std::map<std::string, std::string> noop;
+ mapComplete(boost::beast::http::status::bad_request, noop);
return;
}