Open rahult-github opened 4 months ago
@sjanc Please take a look and review
Hi @sjanc ,
So data here is the pointer which is passed as parameter to ble_gap_ext_adv_set_data. Apps like bleprph, create a data pointer, allocate it and then invoke ble_gap_ext_adv_set_data . Since the function does have the code to free the "os_mbuf *data" , this change is to also NULL initialize it.
you set local variable literally just before returning from function. that is just pointless.
After buffer is freed, explicitly NULL assign the pointer to data.