Check for active_gateway being non NULL before dereferencing it
authorSamuel Ortiz <sameo@linux.intel.com>
Mon, 29 Jun 2009 19:17:39 +0000 (21:17 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 30 Jun 2009 01:08:42 +0000 (03:08 +0200)
src/connection.c

index d057d8a..b20a5a1 100644 (file)
@@ -654,6 +654,6 @@ void __connman_connection_update_gateway(void)
        active_gateway = find_active_gateway();
        default_gateway = find_default_gateway();
 
-       if (active_gateway != default_gateway)
+       if (active_gateway && active_gateway != default_gateway)
                del_route(active_gateway->element, active_gateway->gateway);
 }