From 6f1671c9c99af4d82e37e8b2fe10d9a7443f901a Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Sat, 6 Jul 2024 00:00:48 +0700 Subject: [PATCH] fix(i2c): fix memory allocation size in example --- .../i2c/i2c_eeprom/components/i2c_eeprom/i2c_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/peripherals/i2c/i2c_eeprom/components/i2c_eeprom/i2c_eeprom.c b/examples/peripherals/i2c/i2c_eeprom/components/i2c_eeprom/i2c_eeprom.c index 628730ed4a..a57f9ec15a 100644 --- a/examples/peripherals/i2c/i2c_eeprom/components/i2c_eeprom/i2c_eeprom.c +++ b/examples/peripherals/i2c/i2c_eeprom/components/i2c_eeprom/i2c_eeprom.c @@ -25,7 +25,7 @@ esp_err_t i2c_eeprom_init(i2c_master_bus_handle_t bus_handle, const i2c_eeprom_c { esp_err_t ret = ESP_OK; i2c_eeprom_handle_t out_handle; - out_handle = (i2c_eeprom_handle_t)calloc(1, sizeof(i2c_eeprom_handle_t)); + out_handle = (i2c_eeprom_handle_t)calloc(1, sizeof(*out_handle)); ESP_GOTO_ON_FALSE(out_handle, ESP_ERR_NO_MEM, err, TAG, "no memory for i2c eeprom device"); i2c_device_config_t i2c_dev_conf = {