diff --git a/src/login/logind-user.c b/src/login/logind-user.c index 4622812e3..0a3f22ce9 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -259,9 +259,7 @@ static int user_mkdir_runtime_path(User *u) { } if (!u->runtime_path) { - p = strappend("/run/user/", u->name); - - if (!p) { + if (asprintf(&p, "/run/user/%lu", (unsigned long) u->uid) < 0) { log_error("Out of memory"); return -ENOMEM; }