commit | 85287d3989359231026807bac52364cbe49b8d84 | [log] [tgz] |
---|---|---|
author | Mark Slee <mcslee@apache.org> | Mon Jul 09 19:50:30 2007 +0000 |
committer | Mark Slee <mcslee@apache.org> | Mon Jul 09 19:50:30 2007 +0000 |
tree | ac944a48f83ef03133f20f61b38377ac5522baae | |
parent | e6c4fa671e63f9bfcc443d3fb5802e886f237c9a [diff] |
Fix addrinfo structure memory leak in TSocket Summary: Need to free the IPv6 memory structure Reviewed By: mcslee Notes: Submitted by paul@powerset.com git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665157 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/concurrency/Mutex.h b/lib/cpp/src/concurrency/Mutex.h index d4788b3..7945e05 100644 --- a/lib/cpp/src/concurrency/Mutex.h +++ b/lib/cpp/src/concurrency/Mutex.h
@@ -48,7 +48,7 @@ impl* impl_; }; -class Guard{ +class Guard { public: Guard(const Mutex& value) : mutex_(value) { mutex_.lock();
diff --git a/lib/cpp/src/transport/TSocket.cpp b/lib/cpp/src/transport/TSocket.cpp index bfd3387..a5a07b3 100644 --- a/lib/cpp/src/transport/TSocket.cpp +++ b/lib/cpp/src/transport/TSocket.cpp
@@ -249,10 +249,14 @@ close(); } else { close(); + freeaddrinfo(res0); // cleanup on failure throw; } } } + + // Free address structure memory + freeaddrinfo(res0); } void TSocket::close() {