From: Willy Tarreau Date: Wed, 26 Feb 2020 13:03:05 +0000 (+0100) Subject: MINOR: wdt: always clear sigev_value to make valgrind happy X-Git-Tag: v2.2-dev4~118 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1563e5474b979bbde59464fa67a927603f112b7;p=thirdparty%2Fhaproxy.git MINOR: wdt: always clear sigev_value to make valgrind happy In issue #471 it was reported that valgrind sometimes complains about timer_create() being called with uninitialized bytes. These are in fact the bits from sigev_value.sival_ptr that are not part of sival_int that are tagged as such, as valgrind has no way to know we're using the int instead of the ptr in the union. It's cheap to initialize the field so let's do it. --- diff --git a/src/wdt.c b/src/wdt.c index 8f31e94920..8ccdb04054 100644 --- a/src/wdt.c +++ b/src/wdt.c @@ -129,7 +129,7 @@ void wdt_handler(int sig, siginfo_t *si, void *arg) int init_wdt_per_thread() { - struct sigevent sev; + struct sigevent sev = { }; sigset_t set; /* unblock the WDTSIG signal we intend to use */