summaryrefslogtreecommitdiff
path: root/src/bluetooth-common.c
diff options
context:
space:
mode:
authorSyam Sidhardhan <s.syam@samsung.com>2017-06-15 19:52:34 +0530
committerSyam Sidhardhan <s.syam@samsung.com>2017-06-15 19:52:59 +0530
commit948e3dec1c24d098f5b33c1e53c63b3f5ef132d8 (patch)
treee1cff6f9b0fa3be5bb6f2e7cf8cb77d12cf1ae7c /src/bluetooth-common.c
parent0f08cb8c0d7f9dd20702618dab70f061b6a8e014 (diff)
downloadbluetooth-948e3dec1c24d098f5b33c1e53c63b3f5ef132d8.tar.gz
bluetooth-948e3dec1c24d098f5b33c1e53c63b3f5ef132d8.tar.bz2
bluetooth-948e3dec1c24d098f5b33c1e53c63b3f5ef132d8.zip
common: Fix memory leak
We have to free the allocated memory. Change-Id: I040d3e0d57fa7967a5e4e3f456ec936b9f1f2ba2 Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Diffstat (limited to 'src/bluetooth-common.c')
-rw-r--r--src/bluetooth-common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c
index 081b1c1..2ea0c38 100644
--- a/src/bluetooth-common.c
+++ b/src/bluetooth-common.c
@@ -1570,11 +1570,12 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
void *user_data = data->user_data;
free(data);
- bt_map_client_message_s* res = malloc(sizeof(*res));
+ bt_map_client_message_s *res = g_malloc0(sizeof(bt_map_client_message_s));
res->file_path = target_file;
((bt_map_client_get_message_cb)bt_event_slot_container[event_index].callback)(
param->result, res, user_data);
+ g_free(res);
break;
case BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE:
@@ -2467,6 +2468,8 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
(_bt_get_error_code(param->result), (bt_device_att_mtu_info_s *)mtu_info,
bt_event_slot_container[event_index].user_data);
+ g_free(mtu_info);
+
break;
}
case BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED: