From: Yu Watanabe Date: Thu, 14 Feb 2019 01:59:13 +0000 (+0900) Subject: login: add a missing error check for session_set_leader() X-Git-Tag: v242~381 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe3ab8458b9c0ead4b3e14ac25b342d8c34376fe;p=platform%2Fupstream%2Fsystemd.git login: add a missing error check for session_set_leader() session_set_leader() may fail. If it fails, then manager_start_scope() will trigger assertion. This may be related to RHBZ#1663704. --- diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 8ab498f..b9ea370 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -790,7 +790,9 @@ static int method_create_session(sd_bus_message *message, void *userdata, sd_bus goto fail; session_set_user(session, user); - session_set_leader(session, leader); + r = session_set_leader(session, leader); + if (r < 0) + goto fail; session->type = t; session->class = c;