There is a possibility to miss unref-ing when source/sink fails at
setup.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
sink->connect_id = a2dp_discover(sink->session, discovery_complete,
sink);
- if (sink->connect_id == 0)
+ if (sink->connect_id == 0) {
+ avdtp_unref(sink->session);
+ sink->session = NULL;
return FALSE;
+ }
return TRUE;
}
source->connect_id = a2dp_discover(source->session, discovery_complete,
source);
- if (source->connect_id == 0)
+ if (source->connect_id == 0) {
+ avdtp_unref(source->session);
+ source->session = NULL;
return FALSE;
+ }
return TRUE;
}