X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind-session.c;h=0799a98f2428b8eaf8946b273513043e1e1485b6;hp=84e199f6a27f6644c68f2514d2d25a9f60c5c290;hb=a61ff8a1eea921800d6225ff137b24e0a0fb60e1;hpb=5d3c70eec7861aa623adeac659ac4a6f890557d2 diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 84e199f6a..0799a98f2 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -35,7 +35,7 @@ #include "escape.h" #include "fd-util.h" #include "fileio.h" -#include "formats-util.h" +#include "format-util.h" #include "io-util.h" #include "logind-session.h" #include "mkdir.h" @@ -62,16 +62,13 @@ Session* session_new(Manager *m, const char *id) { return NULL; s->state_file = strappend("/run/systemd/sessions/", id); - if (!s->state_file) { - free(s); - return NULL; - } + if (!s->state_file) + return mfree(s); s->devices = hashmap_new(&devt_hash_ops); if (!s->devices) { free(s->state_file); - free(s); - return NULL; + return mfree(s); } s->id = basename(s->state_file); @@ -79,8 +76,7 @@ Session* session_new(Manager *m, const char *id) { if (hashmap_put(m->sessions, s->id, s) < 0) { hashmap_free(s->devices); free(s->state_file); - free(s); - return NULL; + return mfree(s); } s->manager = m; @@ -516,7 +512,7 @@ static int session_start_scope(Session *s) { char *scope, *job = NULL; const char *description; - scope = strjoin("session-", s->id, ".scope", NULL); + scope = strjoin("session-", s->id, ".scope"); if (!scope) return log_oom();