summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2017-06-13 09:01:06 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-06-13 09:03:33 -0500
commit8451edf556036d89629f38b6243f465ff9d2822d (patch)
tree061db9dfaccebc3283f00b333b29febfbb343a32
parent758c1aecbaaa8b120b0203b6a5b106e3e599180d (diff)
downloadphosphor-host-ipmid-8451edf556036d89629f38b6243f465ff9d2822d.tar.gz
phosphor-host-ipmid-8451edf556036d89629f38b6243f465ff9d2822d.zip
sensorhandler: add missing pointer initialization
An uninitialized pointer was being sent to 'free' in cases where a dbus object was not found to back a sensor. Fixes openbmc/openbmc#1740. Change-Id: Iaa62bfe460c47f4a51a506b0219879f0b6d46dd4 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
-rw-r--r--sensorhandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index eacc274..71376d2 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -185,7 +185,7 @@ int find_openbmc_path(uint8_t num, dbus_interface_t *interface) {
const auto& info = sensor_it->second;
- char* busname;
+ char* busname = nullptr;
rc = get_bus_for_path(info.sensorPath.c_str(), &busname);
if (rc < 0) {
fprintf(stderr, "Failed to get %s busname: %s\n",
OpenPOWER on IntegriCloud