Add a NULL check to prevent dereferencing a null pointer in case the adapter is NULL --- src/profile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/profile.c b/src/profile.c index c62224af9..bb988e8cb 100644 --- a/src/profile.c +++ b/src/profile.c @@ -1507,7 +1507,8 @@ static void ext_remove_records(struct ext_profile *ext, ext->records = g_slist_remove(ext->records, r); - adapter_service_remove(adapter, r->handle); + if (adapter) + adapter_service_remove(adapter, r->handle); btd_adapter_unref(r->adapter); g_free(r); } -- 2.43.0