hwclock: add missing OOM check

This commit is contained in:
Lennart Poettering 2012-09-21 16:29:09 +02:00
parent 8e7705e52a
commit 4eeebf70aa
1 changed files with 5 additions and 0 deletions

View File

@ -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);