From d159649494a538e86bb7b2575a1596caffafd95a Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 13 Nov 2014 19:27:31 -0800 Subject: [PATCH] Bug 1098703 - Zero HttpBaseChannel::{mSelfAddr,mPeerAddr} on construction to avoid Valgrind complaints in e10s builds. r=michal. --HG-- extra : rebase_source : b95ade0b14397103711f74a53e75c514df2e1e1b --- netwerk/protocol/http/HttpBaseChannel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index a0f28afc8e2b..e4006ab79c7c 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -82,7 +82,13 @@ HttpBaseChannel::HttpBaseChannel() { LOG(("Creating HttpBaseChannel @%x\n", this)); - // Subfields of unions cannot be targeted in an initializer list + // Subfields of unions cannot be targeted in an initializer list. +#ifdef MOZ_VALGRIND + // Zero the entire unions so that Valgrind doesn't complain when we send them + // to another process. + memset(&mSelfAddr, 0, sizeof(NetAddr)); + memset(&mPeerAddr, 0, sizeof(NetAddr)); +#endif mSelfAddr.raw.family = PR_AF_UNSPEC; mPeerAddr.raw.family = PR_AF_UNSPEC; }