From 49a83a0cacc23e852091bf133ca9c3e9f23e9513 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Wed, 8 Feb 2017 08:27:34 +0000 Subject: [PATCH] am_munmap_both_wrk: safely initialise out-param for all return paths. Silences what I think is a false complaint from gcc at -O3. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16221 --- coregrind/m_aspacemgr/aspacemgr-linux.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 907ceb774c..62bc170580 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -2773,6 +2773,9 @@ SysRes am_munmap_both_wrk ( /*OUT*/Bool* need_discard, Bool d; SysRes sres; + /* Be safe with this regardless of return path. */ + *need_discard = False; + if (!VG_IS_PAGE_ALIGNED(start)) goto eINVAL; -- 2.47.2