Skip to content

Commit fa72abd

Browse files
committed
Fix from review
1 parent fdab1ae commit fa72abd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/mqtt_client.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,7 +2764,11 @@ int MqttClient_Auth(MqttClient *client, MqttAuth* auth)
27642764
wm_SemUnlock(&client->lockClient);
27652765
}
27662766
if (rc != 0) {
2767+
/* Save write.len before MqttWriteStop zeroes client->write */
2768+
int xfer = client->write.len;
27672769
MqttWriteStop(client, &auth->stat);
2770+
/* Clear tx_buf to remove SASL auth data before returning */
2771+
CLIENT_FORCE_ZERO(client->tx_buf, xfer);
27682772
return rc; /* Error locking client */
27692773
}
27702774
#endif

0 commit comments

Comments
 (0)