From 8f619dd6228f1cfa750e562d4e2ea89396e8b4fd Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 9 Mar 2009 16:53:03 -0300 Subject: Don't pass stream to config callback if there was an error --- audio/a2dp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'audio') diff --git a/audio/a2dp.c b/audio/a2dp.c index e633c855..83e12c9e 100644 --- a/audio/a2dp.c +++ b/audio/a2dp.c @@ -150,13 +150,15 @@ static gboolean finalize_config(struct a2dp_setup *s) setup_ref(s); for (l = s->cb; l != NULL; l = l->next) { struct a2dp_setup_cb *cb = l->data; + struct avdtp_stream *stream = s->err ? NULL : s->stream; - if (cb->config_cb) { - cb->config_cb(s->session, s->sep, s->stream, s->err, - cb->user_data); - cb->config_cb = NULL; - setup_unref(s); - } + if (!cb->config_cb) + continue; + + cb->config_cb(s->session, s->sep, stream, s->err, + cb->user_data); + cb->config_cb = NULL; + setup_unref(s); } setup_unref(s); -- cgit