From 50a72980c03d3bfc11c57f67b7f7193df8b2c12c Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 5 Jun 2013 13:42:32 +0300 Subject: [PATCH] core: Fix find included handling with sudden disconnections --- src/device.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/device.c b/src/device.c index 55842b638..d4c1e23e0 100644 --- a/src/device.c +++ b/src/device.c @@ -3177,6 +3177,13 @@ static void find_included_cb(GSList *includes, uint8_t status, struct gatt_primary *prim; GSList *l; + if (device->attrib == NULL) { + error("Disconnected while doing included discovery"); + g_slist_free(search->services); + g_free(search); + return; + } + if (status != 0) { error("Find included services failed: %s (%d)", att_ecode2str(status), status); -- 2.47.3