diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-21 16:29:09 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-21 16:29:09 +0200 |
commit | 4eeebf70aa5ac9825899f5a063431329904d37e5 (patch) | |
tree | fe6c612dd38064859525c4c004b14f176f8f6918 /src/shared/hwclock.c | |
parent | 8e7705e52a5f84489d3037c09fa5f9397185560d (diff) |
hwclock: add missing OOM check
Diffstat (limited to 'src/shared/hwclock.c')
-rw-r--r-- | src/shared/hwclock.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/shared/hwclock.c b/src/shared/hwclock.c index b93855d957..0e8fa45971 100644 --- a/src/shared/hwclock.c +++ b/src/shared/hwclock.c @@ -94,6 +94,11 @@ static int rtc_open(int flags) { continue; p = strappend("/dev/", de->d_name); + if (!p) { + closedir(d); + return -ENOMEM; + } + fd = open(p, flags); free(p); |