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:
commit
6c269e6402
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user