From 8f5f803f17bde189fc96a715498a98756ae9ff2b Mon Sep 17 00:00:00 2001 From: Nick Pelly <npelly@xxxxxxxxxx> Date: Thu, 26 Mar 2009 15:22:32 -0700 Subject: [PATCH] Null pointer check on cb in finalize_resume(). Fix a null pointer crash that occured when resuming A2DP streaming after making an outgoing call. This patch has not been verified in Bluez 4.x. --- audio/a2dp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/audio/a2dp.c b/audio/a2dp.c index 7461f17..5fd6be4 100644 --- a/audio/a2dp.c +++ b/audio/a2dp.c @@ -183,7 +183,7 @@ static gboolean finalize_resume(struct a2dp_setup *s) for (l = s->cb; l != NULL; l = l->next) { struct a2dp_setup_cb *cb = l->data; - if (cb->resume_cb) { + if (cb && cb->resume_cb) { cb->resume_cb(s->session, s->err, cb->user_data); cb->resume_cb = NULL; setup_unref(s); -- 1.5.5