if (value_length > 0)
BT_CHECK_INPUT_PARAMETER(value);
- chr = malloc(sizeof(*chr));
- if (chr == NULL)
- return BT_ERROR_OUT_OF_MEMORY;
+ chr = g_malloc(sizeof(*chr));
memset(chr, 0x00, sizeof(*chr));
if (value_length > 0)
BT_CHECK_INPUT_PARAMETER(value);
- desc = malloc(sizeof(*desc));
- if (desc == NULL)
- return BT_ERROR_OUT_OF_MEMORY;
-
+ desc = g_malloc(sizeof(*desc));
memset(desc, 0x00, sizeof(*desc));
desc->type = BT_GATT_TYPE_DESCRIPTOR;
client_s->remote_address = g_strdup(remote_address);
if (client_s->remote_address == NULL) {
- free(client_s);
+ g_free(client_s);
ret = BT_ERROR_OUT_OF_MEMORY;
BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
return ret;
monitor_s->remote_address = g_strdup(remote_address);
if (monitor_s->remote_address == NULL) {
- free(monitor_s);
+ g_free(monitor_s);
error_code = BT_ERROR_OUT_OF_MEMORY;
BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);
return error_code;