File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -437,10 +437,17 @@ void mqttClientStop(bool shutdown)
437
437
}
438
438
439
439
// Release the buffers
440
- if (mqttClientPrivateKeyBuffer)
440
+ if (mqttClientPrivateKeyBuffer != nullptr )
441
+ {
441
442
free (mqttClientPrivateKeyBuffer);
442
- if (mqttClientCertificateBuffer)
443
+ mqttClientPrivateKeyBuffer = nullptr ;
444
+ }
445
+
446
+ if (mqttClientCertificateBuffer != nullptr )
447
+ {
443
448
free (mqttClientCertificateBuffer);
449
+ mqttClientCertificateBuffer = nullptr ;
450
+ }
444
451
445
452
reportHeapNow (settings.debugMqttClientState );
446
453
@@ -559,12 +566,14 @@ void mqttClientUpdate()
559
566
if (mqttClientCertificateBuffer)
560
567
{
561
568
free (mqttClientCertificateBuffer);
569
+ mqttClientCertificateBuffer = nullptr ;
562
570
systemPrintln (" Failed to allocate key buffer!" );
563
571
}
564
572
565
573
if (mqttClientPrivateKeyBuffer)
566
574
{
567
575
free (mqttClientPrivateKeyBuffer);
576
+ mqttClientPrivateKeyBuffer = nullptr ;
568
577
systemPrintln (" Failed to allocate certificate buffer!" );
569
578
}
570
579
You can’t perform that action at this time.
0 commit comments