Protecting against potential NULL pointer dereference
[platform/upstream/at-spi2-core.git] / atspi / atspi-gmain.c
index 588a60d..0e7b143 100644 (file)
@@ -8,7 +8,7 @@
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -139,6 +139,9 @@ connection_setup_new (GMainContext   *context,
 
       cs->message_queue_source = g_source_new ((GSourceFuncs *) &message_queue_funcs,
                                                sizeof (DBusGMessageQueue));
+
+      g_assert (cs->message_queue_source != NULL);
+
       ((DBusGMessageQueue*)cs->message_queue_source)->connection = connection;
       g_source_attach (cs->message_queue_source, cs->context);
     }