seat can be NULL but it is used in _is_valid_switch_user_dbus_request()
without NULL check.
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
Change-Id: I56ab152b49230f862d5d83e82ac6eef4863deafe
TlmDbusRequest *dbus_request,
TlmSeat *seat)
{
+ g_return_val_if_fail (seat && TLM_IS_SEAT(seat), FALSE);
gboolean ret = TRUE;
gchar *occupying_username = tlm_seat_get_occupying_username(seat);
if (0 == g_strcmp0(dbus_request->username,occupying_username)) {
goto _finished;
}
- if (req->seat && req->seat != seat) {
- g_object_unref(req->seat);
+ if (req->seat != seat) {
+ if (req->seat)
+ g_object_unref(req->seat);
req->seat = seat;
g_object_ref(req->seat);
}