From 6e9520533395b19ed6f6a17de6f196aa5e93da9f Mon Sep 17 00:00:00 2001 From: Taras Shpot Date: Fri, 15 Oct 2010 17:45:02 +0200 Subject: Fix memory leak under Windows The comment about memory ownership in uuid_t::to_string was misleading as on most platforms the buffer is a field of the object; The string allocated in UuidToString() wasn't properly freed with RpcStringFree() Signed-off-by: Taras Shpot --- src/uuid.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/uuid.cpp') diff --git a/src/uuid.cpp b/src/uuid.cpp index f1dddf0..a119be0 100644 --- a/src/uuid.cpp +++ b/src/uuid.cpp @@ -41,6 +41,8 @@ zmq::uuid_t::uuid_t () zmq::uuid_t::~uuid_t () { + if (string_buf) + RpcStringFree (&string_buf); } const char *zmq::uuid_t::to_string () -- cgit v1.2.3