Skip to content

Commit

Permalink
Merge branch 'bugfix/null_assign_variable_v5.0' into 'release/v5.0'
Browse files Browse the repository at this point in the history
fix(wifi_prov): Use calloc instead of malloc to zero initialize variable (v5.0)

See merge request espressif/esp-idf!33967
  • Loading branch information
mahavirj committed Oct 4, 2024
2 parents e7f8d97 + caa4def commit be14d6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/protocomm/src/simple_ble/simple_ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit be14d6c

Please sign in to comment.