From: sinikang Date: Mon, 11 Sep 2017 04:52:31 +0000 (+0900) Subject: Fix svace issue X-Git-Tag: submit/tizen/20170912.053101^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba09c33c529d039a3d5962cc423b8279489f56bc;p=platform%2Fcore%2Ftelephony%2Ftel-plugin-syspopup.git Fix svace issue Change-Id: I177d3da05c36af60aabdfa8af5a222dd3786a0cf --- diff --git a/packaging/tel-plugin-syspopup.spec b/packaging/tel-plugin-syspopup.spec index d4682bc..dc76d5c 100644 --- a/packaging/tel-plugin-syspopup.spec +++ b/packaging/tel-plugin-syspopup.spec @@ -1,6 +1,6 @@ %define major 0 %define minor 1 -%define patchlevel 7 +%define patchlevel 8 Name: tel-plugin-syspopup Version: %{major}.%{minor}.%{patchlevel} diff --git a/src/notifier.c b/src/notifier.c index 1b8b508..5b87c8c 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -744,10 +744,15 @@ static void on_storage_key_callback(enum tcore_storage_key key, void *value, voi 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; diff --git a/src/notifier_preferred_network.c b/src/notifier_preferred_network.c index 38e9edc..8d5f376 100644 --- a/src/notifier_preferred_network.c +++ b/src/notifier_preferred_network.c @@ -185,9 +185,11 @@ static void __apply_preferred_voice_change(TcorePlugin *plugin) 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); + } } } @@ -266,7 +268,8 @@ static enum tcore_hook_return on_hook_call_status_change(Server *s, CoreObject * 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;