All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] avdtp: fix possible minor problems
@ 2022-06-29 12:46 lishengyu
  2022-06-29 13:55 ` [BlueZ] " bluez.test.bot
  2022-06-30 20:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: lishengyu @ 2022-06-29 12:46 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: lishengyu

It should always be considered that if send_request fails, sep
should be removed from the list and the requested memory freed;
---
 profiles/audio/avdtp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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;
 	}
 
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-30 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-29 12:46 [PATCH BlueZ] avdtp: fix possible minor problems lishengyu
2022-06-29 13:55 ` [BlueZ] " bluez.test.bot
2022-06-30 20:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.