Fixed memory leak

This commit is contained in:
Ollo 2021-11-14 13:51:52 +01:00
parent 66d69eab6b
commit a457db4447

View File

@ -208,7 +208,7 @@ void readOneWireSensors()
continue; continue;
} }
char buf[sizeof(ds18b20Address) * 2]; char buf[(sizeof(ds18b20Address) * 2)+1]; /* additional byte for trailing terminator */
snprintf(buf, sizeof(buf), "%.2X%.2X%.2X%.2X%.2X%.2X%.2X%.2X", snprintf(buf, sizeof(buf), "%.2X%.2X%.2X%.2X%.2X%.2X%.2X%.2X",
ds18b20Address[0], ds18b20Address[0],
ds18b20Address[1], ds18b20Address[1],