From 579a1ebef397833e7f788988a3e78530042570e1 Mon Sep 17 00:00:00 2001 From: Pekka Pessi Date: Fri, 21 Jan 2011 14:44:04 +0200 Subject: message-waiting: check for NULL argument --- src/message-waiting.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/message-waiting.c b/src/message-waiting.c index d8bfe34b..0e376b60 100644 --- a/src/message-waiting.c +++ b/src/message-waiting.c @@ -926,11 +926,18 @@ static void message_waiting_unregister(struct ofono_atom *atom) void ofono_message_waiting_register(struct ofono_message_waiting *mw) { - DBusConnection *conn = ofono_dbus_get_connection(); - const char *path = __ofono_atom_get_path(mw->atom); - struct ofono_modem *modem = __ofono_atom_get_modem(mw->atom); + DBusConnection *conn; + const char *path; + struct ofono_modem *modem; struct ofono_atom *sim_atom; + if (mw == NULL) + return; + + conn = ofono_dbus_get_connection(); + modem = __ofono_atom_get_modem(mw->atom); + path = __ofono_atom_get_path(mw->atom); + if (!g_dbus_register_interface(conn, path, OFONO_MESSAGE_WAITING_INTERFACE, message_waiting_methods, -- cgit v1.2.3