From e888c14489cb5745c11a350d67005afdd929aa2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ronny=20Kr=C3=BCger?= Date: Fri, 16 Jun 2023 00:28:38 +0200 Subject: [PATCH] Fixed a bug in frame's move assignment operator. The zmq_msg_init() at the beginning created a new message overwriting the handle of the old message. But this old message was not closed leaving a memory leak behind. Instead of closing the existing handle explicitly we can simply remove the init call because zmq_msg_move() does the closing of the old message on its own. see https://github.com/zeromq/zmqpp/issues/204 --- src/zmqpp/frame.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/zmqpp/frame.cpp b/src/zmqpp/frame.cpp index 4701aba2..96991efb 100644 --- a/src/zmqpp/frame.cpp +++ b/src/zmqpp/frame.cpp @@ -81,7 +81,6 @@ frame::frame(frame&& other) frame& frame::operator=(frame&& other) { - zmq_msg_init( &_msg ); zmq_msg_move( &_msg, &other._msg ); std::swap( _sent, other._sent );