From e95b477a8706fa4d7f3d0351300c27371c2867ad Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Fri, 2 May 2014 09:00:48 +0200 Subject: [PATCH] Don't add empty metadata to received messages --- src/mechanism.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mechanism.cpp b/src/mechanism.cpp index a4e1bace..17920e3d 100644 --- a/src/mechanism.cpp +++ b/src/mechanism.cpp @@ -142,7 +142,8 @@ int zmq::mechanism_t::parse_metadata (const unsigned char *ptr_, } if (zap_flag) { assert (metadata == NULL); - metadata = new (std::nothrow) metadata_t (dict); + if (!dict.empty ()) + metadata = new (std::nothrow) metadata_t (dict); } return 0; }