From c0b5b4849f8c8126c31bc585d6a8d596b421aec8 Mon Sep 17 00:00:00 2001 From: Martin Xu Date: Tue, 22 Feb 2011 14:23:26 +0800 Subject: [PATCH] connection: Check gateway_hash value before call update_order() When exit from ConnMan, __connman_connection_cleanup() is called before __connman_service_cleanup() which then calls update_order(). __connman_connection_cleanup() sets gateway_hash as NULL, so update_order() will access NULL hash and causes GLib-CRITICAL abort --- src/connection.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/connection.c b/src/connection.c index 6b2dd2b..793bc8f 100644 --- a/src/connection.c +++ b/src/connection.c @@ -385,6 +385,9 @@ gboolean __connman_connection_update_gateway(void) struct gateway_data *active_gateway, *default_gateway; gboolean updated = FALSE; + if (gateway_hash == NULL) + return updated; + update_order(); active_gateway = find_active_gateway(); -- 2.7.4