Fix the svace issue (146010) 64/123064/1 accepted/tizen/unified/20170406.054757 submit/tizen/20170405.055649
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 4 Apr 2017 09:27:54 +0000 (18:27 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 4 Apr 2017 09:27:54 +0000 (18:27 +0900)
Change-Id: I1dc1a50946b1734d80c267e4901a6f72ee4b01c4
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
obexd/plugins/phonebook-tizen.c

index dcb6179..b64bf5a 100755 (executable)
@@ -339,7 +339,7 @@ static void get_phonebook_entry_reply(DBusPendingCall *call, void *user_data)
        DBusMessage *reply = dbus_pending_call_steal_reply(call);
        struct phonebook_data *s_data = user_data;
        DBusError derr;
-       const char *phonebook_entry;
+       const char *phonebook_entry = NULL;
 
        DBG("");
        dbus_pending_call_unref(s_data->call);
@@ -358,10 +358,11 @@ static void get_phonebook_entry_reply(DBusPendingCall *call, void *user_data)
                dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING,
                                        &phonebook_entry, DBUS_TYPE_INVALID);
                DBG("phonebook_entry:[%s]\n", phonebook_entry);
-       }
 
-       s_data->cb(phonebook_entry, strlen(phonebook_entry), 1, 0, TRUE,
-                                                       s_data->user_data);
+               if (phonebook_entry)
+                       s_data->cb(phonebook_entry, strlen(phonebook_entry), 1, 0, TRUE,
+                                                                       s_data->user_data);
+       }
 
        dbus_message_unref(reply);
 }