Commit b483b77b authored by Kenton Varda's avatar Kenton Varda

Fix valgrind issues.

parent 2d67f0b8
...@@ -234,8 +234,17 @@ private: ...@@ -234,8 +234,17 @@ private:
ssize_t writeResult; ssize_t writeResult;
KJ_NONBLOCKING_SYSCALL(writeResult = ::writev(fd, iov.begin(), iov.size())) { KJ_NONBLOCKING_SYSCALL(writeResult = ::writev(fd, iov.begin(), iov.size())) {
// error // Error.
return READY_NOW;
// We can't "return kj::READY_NOW;" inside this block because it causes a memory leak due to
// a bug that exists in both Clang and GCC:
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33799
// http://llvm.org/bugs/show_bug.cgi?id=12286
goto error;
}
if (false) {
error:
return kj::READY_NOW;
} }
// A negative result means EAGAIN, which we can treat the same as having written zero bytes. // A negative result means EAGAIN, which we can treat the same as having written zero bytes.
...@@ -612,6 +621,7 @@ Promise<Array<SocketAddress>> SocketAddress::lookupHost( ...@@ -612,6 +621,7 @@ Promise<Array<SocketAddress>> SocketAddress::lookupHost(
} }
SocketAddress addr; SocketAddress addr;
memset(&addr, 0, sizeof(addr)); // mollify valgrind
if (params.host == "*") { if (params.host == "*") {
// Set up a wildcard SocketAddress. Only use the port number returned by getaddrinfo(). // Set up a wildcard SocketAddress. Only use the port number returned by getaddrinfo().
addr.wildcard = true; addr.wildcard = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment