Skip to content

Commit

Permalink
Fix: Allocation for connection buffer was incorrectly done.
Browse files Browse the repository at this point in the history
By mistake calloc parameters were incorrect.
  • Loading branch information
euripedesrocha committed Jun 21, 2023
1 parent ee3ea29 commit 6c849c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mqtt_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6c849c6

Please sign in to comment.