From 4eeebf70aa5ac9825899f5a063431329904d37e5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 21 Sep 2012 16:29:09 +0200 Subject: hwclock: add missing OOM check --- src/shared/hwclock.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/shared') 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); -- cgit v1.2.3-54-g00ecf