mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(wifi_prov): Use calloc instead of malloc to zero initialize variable
This commit is contained in:
parent
f36b6a088a
commit
916d319155
@ -198,7 +198,7 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_
|
|||||||
|
|
||||||
simple_ble_cfg_t *simple_ble_init(void)
|
simple_ble_cfg_t *simple_ble_init(void)
|
||||||
{
|
{
|
||||||
simple_ble_cfg_t *ble_cfg_p = (simple_ble_cfg_t *) malloc(sizeof(simple_ble_cfg_t));
|
simple_ble_cfg_t *ble_cfg_p = (simple_ble_cfg_t *) calloc(1, sizeof(simple_ble_cfg_t));
|
||||||
if (ble_cfg_p == NULL) {
|
if (ble_cfg_p == NULL) {
|
||||||
ESP_LOGE(TAG, "No memory for simple_ble_cfg_t");
|
ESP_LOGE(TAG, "No memory for simple_ble_cfg_t");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user