summaryrefslogtreecommitdiff
path: root/android/bluetooth.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2014-08-15 13:30:40 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2014-08-15 13:59:26 +0300
commiteec3ccf63f220bc23b74484b965ca5bffc792acb (patch)
tree3aaa48f81738df57dd86c753c0e463ecbddfc192 /android/bluetooth.c
parente64c877ca63534274ad955d08e217481227d1523 (diff)
downloadbluez-eec3ccf63f220bc23b74484b965ca5bffc792acb.tar.gz
android: Fix memory leak
protos gets allocated and needs to be freed
Diffstat (limited to 'android/bluetooth.c')
-rw-r--r--android/bluetooth.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/android/bluetooth.c b/android/bluetooth.c
index d3a0c209c..ba68e9882 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -1144,9 +1144,14 @@ static void find_remote_sdp_rec_cb(sdp_list_t *recs, int err,
goto done;
}
- if (!sdp_get_access_protos(sdp_rec, &protos))
+ if (!sdp_get_access_protos(sdp_rec, &protos)) {
channel = sdp_get_proto_port(protos, L2CAP_UUID);
- else
+
+ sdp_list_foreach(protos,
+ (sdp_list_func_t) sdp_list_free,
+ NULL);
+ sdp_list_free(protos, NULL);
+ } else
channel = -1;
if (channel < 0) {