diff --git a/android/avdtp.c b/android/avdtp.c
index ce75615..b290feb 100644
--- a/android/avdtp.c
+++ b/android/avdtp.c
void *user_data)
{
struct avdtp_local_sep *sep;
+ uint8_t seid = util_get_uid(&seids, MAX_SEID);
+
+ if (!seid)
+ return NULL;
if (g_slist_length(lseps) > MAX_SEID)
return NULL;
sep = g_new0(struct avdtp_local_sep, 1);
sep->state = AVDTP_STATE_IDLE;
- sep->info.seid = util_get_uid(&seids, MAX_SEID);
+ sep->info.seid = seid;
sep->info.type = type;
sep->info.media_type = media_type;
sep->codec = codec_type;