summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorChengyi <zhaochengyi@uniontech.com>2022-06-21 12:31:33 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-06-21 12:33:09 -0700
commit949898cc5e7f0657dff91f799718e54dc4cde723 (patch)
tree8824a453ffcd08ddeb6a7415d48f5cf2441abb2b /profiles
parent19ad4310c9b461783bc73a570be8efffd32b1e42 (diff)
downloadbluez-949898cc5e7f0657dff91f799718e54dc4cde723.tar.gz
avdtp: Free discover when send_request returns error
When send_request returns an error, session->discover should be released here, so that the next time the program enters avdtp_discover, the -EBUSY error will not be returned.
Diffstat (limited to 'profiles')
-rw-r--r--profiles/audio/avdtp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index bc7afad81..0d2213ea2 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -3429,6 +3429,9 @@ int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb,
if (err == 0) {
session->discover->cb = cb;
session->discover->user_data = user_data;
+ } else if (session->discover) {
+ g_free(session->discover);
+ session->discover = NULL;
}
return err;