Fix: Allocation for connection buffer was incorrectly done.

By mistake calloc parameters were incorrect.
This commit is contained in:
Euripedes Rocha
2023-06-21 08:23:24 +02:00
parent ee3ea29d52
commit 6c849c62ef

View File

@ -619,7 +619,7 @@ int mqtt_has_valid_msg_hdr(uint8_t *buffer, size_t length)
esp_err_t mqtt_msg_buffer_init(mqtt_connection_t *connection, int buffer_size)
{
memset(connection, 0, sizeof(mqtt_connection_t));
connection->buffer = (uint8_t *)calloc(0, buffer_size);
connection->buffer = (uint8_t *)calloc(buffer_size, sizeof(uint8_t));
if (!connection->buffer) {
return ESP_ERR_NO_MEM;
}