summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorlishengyu <lishengyu@uniontech.com>2022-06-29 20:46:56 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-06-30 13:26:10 -0700
commit44658fccacda3ade0ca2adbb2643b489671fe477 (patch)
tree8dd4237a41d4a42d955070551a589aa37a19d1ca /profiles
parentbe7ebf29b370d298290f6a4eceb31b1d9c94081c (diff)
downloadbluez-44658fccacda3ade0ca2adbb2643b489671fe477.tar.gz
avdtp: fix possible minor problems
It should always be considered that if send_request fails, sep should be removed from the list and the requested memory freed;
Diffstat (limited to 'profiles')
-rw-r--r--profiles/audio/avdtp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 0d2213ea2..10ef380d4 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -2765,8 +2765,11 @@ static gboolean avdtp_discover_resp(struct avdtp *session,
ret = send_request(session, TRUE, NULL, getcap_cmd,
&req, sizeof(req));
- if (ret < 0)
+ if (ret < 0) {
+ session->seps = g_slist_remove(session->seps, sep);
+ g_free(sep);
break;
+ }
getcap_pending = TRUE;
}