Commit fc31a19d authored by Michael Ott's avatar Michael Ott
Browse files

Fix segfault in IPMIHost::readSensorRecord() when de-referencing a NULL reading pointer on return

parent 429e5336
......@@ -261,10 +261,14 @@ double IPMIHost::readSensorRecord(std::vector<uint8_t>& record) {
return 0;
}
_errorCount = 0;
_lastRead = getTimestamp();
return *reading;
double ret = .0;
if (reading) {
_errorCount = 0;
_lastRead = getTimestamp();
ret = *reading;
free(reading);
}
}
void IPMIHost::increaseErrorCount() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment