gatserver: Add NULL check to avoid crash
authorGuillaume Zajac <guillaume.zajac@linux.intel.com>
Tue, 26 Jun 2012 08:12:59 +0000 (10:12 +0200)
committerDenis Kenzior <denkenz@gmail.com>
Sun, 24 Jun 2012 22:40:59 +0000 (17:40 -0500)
Dundee is not waiting to receive the NO CARRIER notification
to close the IO channel with oFono so that oFono is trying to
send a NO CARRIER although GAtServer is removed.

gatchat/gatserver.c

index 7c87c7a..e3cbb8f 100644 (file)
@@ -222,6 +222,9 @@ static inline void send_final_numeric(GAtServer *server, GAtServerResult result)
 
 void g_at_server_send_final(GAtServer *server, GAtServerResult result)
 {
+       if (server == NULL)
+               return;
+
        if (server->final_sent != FALSE)
                return;