headset: Fix missing check for non-existent pending message

This commit is contained in:
Johan Hedberg 2011-09-21 17:27:04 +09:00
parent 26bc2d99dd
commit 3169c1bef4

View File

@ -1536,7 +1536,8 @@ static void get_record_cb(sdp_list_t *recs, int err, gpointer user_data)
if (err < 0) {
error("Unable to connect: %s (%d)", strerror(-err), -err);
p->err = -err;
error_connect_failed(dev->conn, p->msg, p->err);
if (p->msg != NULL)
error_connect_failed(dev->conn, p->msg, p->err);
goto failed;
}