Fix: Don't try to unregister a null mcc/mnc

Network operators with null MCC & MNC are not registered, but we try to
unregister them.  Don't do this as it causes a crash.
This commit is contained in:
Denis Kenzior 2010-01-13 11:40:15 -06:00
parent 506eb11b02
commit d9bb71e521
1 changed files with 7 additions and 1 deletions

View File

@ -1607,8 +1607,14 @@ static void netreg_unregister(struct ofono_atom *atom)
__ofono_watchlist_free(netreg->status_watches);
netreg->status_watches = NULL;
for (l = netreg->operator_list; l; l = l->next)
for (l = netreg->operator_list; l; l = l->next) {
struct network_operator_data *opd = l->data;
if (opd->mcc[0] == '\0' && opd->mnc[0] == '\0')
continue;
network_operator_dbus_unregister(netreg, l->data);
}
g_slist_free(netreg->operator_list);
netreg->operator_list = NULL;