diff options
author | Syam Sidhardhan <s.syam@samsung.com> | 2017-06-15 19:52:34 +0530 |
---|---|---|
committer | Syam Sidhardhan <s.syam@samsung.com> | 2017-06-15 19:52:59 +0530 |
commit | 948e3dec1c24d098f5b33c1e53c63b3f5ef132d8 (patch) | |
tree | e1cff6f9b0fa3be5bb6f2e7cf8cb77d12cf1ae7c /src/bluetooth-common.c | |
parent | 0f08cb8c0d7f9dd20702618dab70f061b6a8e014 (diff) | |
download | bluetooth-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.c | 5 |
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: |