diff options
Diffstat (limited to 'src/shared')
-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); |