Fix svace issue 50/149250/1 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20170913.002655 submit/tizen_4.0/20170912.053242 tizen_4.0.IoT.p1_release tizen_4.0.IoT.p2_release tizen_4.0.m2_release
authorsinikang <sinikang@samsung.com>
Mon, 11 Sep 2017 04:52:31 +0000 (13:52 +0900)
committersinikang <sinikang@samsung.com>
Tue, 12 Sep 2017 02:50:54 +0000 (11:50 +0900)
Change-Id: I177d3da05c36af60aabdfa8af5a222dd3786a0cf

packaging/tel-plugin-syspopup.spec
src/notifier.c
src/notifier_preferred_network.c

index d4682bcdf2c9270890645e847271d9a591340413..dc76d5cf74d42cdfa89d98740ea9a64d1a9cb889 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 1
-%define patchlevel 7
+%define patchlevel 8
 
 Name:           tel-plugin-syspopup
 Version:        %{major}.%{minor}.%{patchlevel}
index 1b8b5085b20b0ba10c8aa2991c851b5058b9d05d..5b87c8c78808bca251fc96ce8c25eef5e1cfab40 100644 (file)
@@ -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;
index 38e9edceba648d3fe2d940cb952de34cb05aec90..8d5f376eb6d7b41a2e96e975abdff6d256fc19b0 100644 (file)
@@ -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;