You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2015/10/11 09:27:32 UTC
thrift git commit: THRIFT-3237 Fix TNamedPipeServer::createNamedPipe
memory leak
Repository: thrift
Updated Branches:
refs/heads/master a175437f6 -> d9d512085
THRIFT-3237 Fix TNamedPipeServer::createNamedPipe memory leak
Client: cpp
Patch: Paweł Janicki & James E. King, III
This closes #632
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/d9d51208
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/d9d51208
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/d9d51208
Branch: refs/heads/master
Commit: d9d51208549d0fe630791847b2904410c418d829
Parents: a175437
Author: Roger Meier <ro...@apache.org>
Authored: Sun Oct 11 09:13:37 2015 +0200
Committer: Roger Meier <ro...@apache.org>
Committed: Sun Oct 11 09:13:37 2015 +0200
----------------------------------------------------------------------
lib/cpp/src/thrift/transport/TPipeServer.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/d9d51208/lib/cpp/src/thrift/transport/TPipeServer.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TPipeServer.cpp b/lib/cpp/src/thrift/transport/TPipeServer.cpp
index baa2603..7923102 100644
--- a/lib/cpp/src/thrift/transport/TPipeServer.cpp
+++ b/lib/cpp/src/thrift/transport/TPipeServer.cpp
@@ -351,12 +351,17 @@ bool TNamedPipeServer::createNamedPipe(const TAutoCrit & /*lockProof*/) {
0, // client time-out
&sa)); // security attributes
+ DWORD lastError = GetLastError();
+ LocalFree(sd);
+ LocalFree(acl);
+ FreeSid(everyone_sid);
+
if (hPipe.h == INVALID_HANDLE_VALUE) {
Pipe_.reset();
- GlobalOutput.perror("TPipeServer::TCreateNamedPipe() GLE=", GetLastError());
+ GlobalOutput.perror("TPipeServer::TCreateNamedPipe() GLE=", lastError);
throw TTransportException(TTransportException::NOT_OPEN,
"TCreateNamedPipe() failed",
- GetLastError());
+ lastError);
return false;
}