From caa4defb73a7d3439927e80055189e00366e09d9 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Thu, 1 Aug 2024 17:50:18 +0530 Subject: [PATCH] fix(wifi_prov): Use calloc instead of malloc to zero initialize variable --- components/protocomm/src/simple_ble/simple_ble.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/protocomm/src/simple_ble/simple_ble.c b/components/protocomm/src/simple_ble/simple_ble.c index 0ea31b54dc..0dc21d6623 100644 --- a/components/protocomm/src/simple_ble/simple_ble.c +++ b/components/protocomm/src/simple_ble/simple_ble.c @@ -195,7 +195,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 *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) { ESP_LOGE(TAG, "No memory for simple_ble_cfg_t"); return NULL;