Skip to content

Commit b95045a

Browse files
committed
Free malloc'd keys. Stop WiFi after PointPerfect update.
1 parent 17cff2f commit b95045a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Firmware/RTK_Surveyor/menuPP.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ bool provisionDevice()
278278
}
279279

280280
//Subscribe to MQTT channel, grab keys, then stop
281-
282281
bool updatePointPerfectKeys()
283282
{
284283
#ifdef COMPILE_WIFI
@@ -323,6 +322,8 @@ bool updatePointPerfectKeys()
323322
if (tries++ == maxTries)
324323
{
325324
log_d("MQTT failed to connect");
325+
free(certificateContents);
326+
free(keyContents);
326327
return (false);
327328
}
328329

@@ -969,6 +970,8 @@ void menuPointPerfect()
969970
}
970971
else
971972
updatePointPerfectKeys();
973+
974+
wifiStop();
972975
}
973976
#endif
974977
}

0 commit comments

Comments
 (0)