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;
This commit is contained in:
lishengyu 2022-06-29 20:46:56 +08:00 committed by Luiz Augusto von Dentz
parent be7ebf29b3
commit 44658fccac

View File

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