summaryrefslogtreecommitdiff
path: root/src/shared/hwclock.c
diff options
context:
space:
mode:
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);