]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
rtcwake: fix valgrind warning
authorSami Kerola <kerolasa@iki.fi>
Sat, 6 Jun 2015 21:41:51 +0000 (22:41 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 29 Jun 2015 11:39:37 +0000 (13:39 +0200)
==3445== Syscall param ioctl(generic) points to uninitialised byte(s)
==3445==    at 0x4F16477: ioctl (in /usr/lib/libc-2.21.so)
==3445==    by 0x402785: setup_alarm (rtcwake.c:231)
==3445==    by 0x403302: main (rtcwake.c:520)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/rtcwake.c

index ebfd420e2ed814ba4de932e8aabff859a8a71a85..a53ed48f9e7fe4a14e8b5f575167d7ed64129c5e 100644 (file)
@@ -207,7 +207,7 @@ static int get_basetimes(struct rtcwake_control *ctl, int fd)
 static int setup_alarm(struct rtcwake_control *ctl, int fd, time_t *wakeup)
 {
        struct tm               *tm;
-       struct rtc_wkalrm       wake;
+       struct rtc_wkalrm       wake = { 0 };
 
        /* The wakeup time is in POSIX time (more or less UTC).  Ideally
         * RTCs use that same time; but PCs can't do that if they need to