Skip to content

Commit

Permalink
login: add a missing error check for session_set_leader()
Browse files Browse the repository at this point in the history
session_set_leader() may fail. If it fails, then manager_start_scope()
will trigger assertion.

This may be related to RHBZ#1663704.
  • Loading branch information
yuwata authored and poettering committed Feb 15, 2019
1 parent 0686255 commit fe3ab84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/login/logind-dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fe3ab84

Please sign in to comment.