mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
update code to use osi_free()
This commit is contained in:
parent
f78298b04a
commit
60bdc4a023
@ -238,7 +238,8 @@ bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg
|
||||
{
|
||||
btc_msg_t* lmsg;
|
||||
|
||||
if (msg == NULL) {
|
||||
// arg XOR arg_len
|
||||
if ((msg == NULL) || ((arg == NULL) == !(arg_len == 0))) {
|
||||
return BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
|
||||
@ -253,7 +254,7 @@ bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg
|
||||
if (arg) {
|
||||
lmsg->arg = (void *)osi_malloc(arg_len);
|
||||
if (lmsg->arg == NULL) {
|
||||
free(lmsg);
|
||||
osi_free(lmsg);
|
||||
return BT_STATUS_NOMEM;
|
||||
}
|
||||
memset(lmsg->arg, 0x00, arg_len); //important, avoid arg which have no length
|
||||
|
Loading…
Reference in New Issue
Block a user