summaryrefslogtreecommitdiff
path: root/src/shared/hwclock.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-21 16:29:09 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-21 16:29:09 +0200
commit4eeebf70aa5ac9825899f5a063431329904d37e5 (patch)
treefe6c612dd38064859525c4c004b14f176f8f6918 /src/shared/hwclock.c
parent8e7705e52a5f84489d3037c09fa5f9397185560d (diff)
hwclock: add missing OOM check
Diffstat (limited to 'src/shared/hwclock.c')
-rw-r--r--src/shared/hwclock.c5
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);