diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-09-21 21:22:41 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-09-21 21:22:41 +0000 |
commit | d0ad1ca444111052434130ea7fb810319bff8f63 (patch) | |
tree | 61cc2ec22d0d50e9d73f067430a47838ea3e7f63 /hcid/dbus-rfcomm.c | |
parent | d97e5a6a819ea0f191c5d660215b6791a5efa4e8 (diff) |
removed memory leak
Diffstat (limited to 'hcid/dbus-rfcomm.c')
-rw-r--r-- | hcid/dbus-rfcomm.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hcid/dbus-rfcomm.c b/hcid/dbus-rfcomm.c index 2aa93be8..d0c28cdb 100644 --- a/hcid/dbus-rfcomm.c +++ b/hcid/dbus-rfcomm.c @@ -613,8 +613,11 @@ static void rfcomm_conn_req_continue(sdp_record_t *rec, void *data, int err) goto failed; } - if (!sdp_get_access_protos(rec, &protos)) + if (!sdp_get_access_protos(rec, &protos)) { ch = sdp_get_proto_port(protos, RFCOMM_UUID); + sdp_list_foreach(protos, (sdp_list_func_t)sdp_list_free, NULL); + sdp_list_free(protos, NULL); + } if (ch == -1) { error_record_does_not_exist(cdata->conn, cdata->msg); goto failed; @@ -851,8 +854,11 @@ static void rfcomm_bind_req_continue(sdp_record_t *rec, void *data, int err) goto failed; } - if (!sdp_get_access_protos(rec, &protos)) + if (!sdp_get_access_protos(rec, &protos)) { ch = sdp_get_proto_port(protos, RFCOMM_UUID); + sdp_list_foreach(protos, (sdp_list_func_t)sdp_list_free, NULL); + sdp_list_free(protos, NULL); + } if (ch == -1) { error_record_does_not_exist(cdata->conn, cdata->msg); goto failed; |