gboolean ui_notifier_init(TcorePlugin *plugin)
{
Server *s;
- ui_noti_data *ud;
+ ui_noti_data *ud = NULL;
guint id;
ud = calloc(sizeof(ui_noti_data), 1);
+ if (ud == NULL) {
+ err("memory allocation failed");
+ return FALSE;
+ }
+
if (tcore_plugin_link_user_data(plugin, ud) != TCORE_RETURN_SUCCESS) {
free(ud);
return FALSE;
if (b_set_preferred_network) {
ui_noti_data *ud = tcore_plugin_ref_user_data(plugin);
- /* Active call not exist, update Preferred Network value to comply Preferred Voice value */
- dbg("call not exist - update PN to comply pv : %d", ud->default_voice_slot);
- __set_preferred_network(modem_plgn, MODEM_INDEX_UNDECIDED, ud->default_voice_slot);
+ if (ud) {
+ /* Active call not exist, update Preferred Network value to comply Preferred Voice value */
+ dbg("call not exist - update PN to comply pv : %d", ud->default_voice_slot);
+ __set_preferred_network(modem_plgn, MODEM_INDEX_UNDECIDED, ud->default_voice_slot);
+ }
}
}
dbg("ongoing call exist - sustain current perferred network state");
} else {/* if not exist - update PN to comply PV */
ui_noti_data *ud = tcore_plugin_ref_user_data((TcorePlugin*)user_data);
- __set_preferred_network(modem_plgn, MODEM_INDEX_UNDECIDED, ud->default_voice_slot);
+ if (ud)
+ __set_preferred_network(modem_plgn, MODEM_INDEX_UNDECIDED, ud->default_voice_slot);
}
break;