1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-27 13:57:26 +03:00

Merge pull request #948 from phomes/master

logind: actually fail on OOM
This commit is contained in:
Daniel Mack 2015-08-14 13:31:36 +02:00
commit 6c269e6402

View File

@ -109,9 +109,11 @@ int inhibitor_save(Inhibitor *i) {
_cleanup_free_ char *cc = NULL;
cc = cescape(i->who);
if (!cc)
if (!cc) {
r = -ENOMEM;
else
goto fail;
}
fprintf(f, "WHO=%s\n", cc);
}
@ -119,9 +121,11 @@ int inhibitor_save(Inhibitor *i) {
_cleanup_free_ char *cc = NULL;
cc = cescape(i->why);
if (!cc)
if (!cc) {
r = -ENOMEM;
else
goto fail;
}
fprintf(f, "WHY=%s\n", cc);
}