Calling zmq_msg_close after zmq_getsockopt causes segment violation

Description

This code crashes immediately that a subscriber gets a message, when trying to close the message:

zmq_msg_t msg;
zmq_msg_init (&msg);
rc = zmq_recv (s, &msg, 0);
int more;
size_t moresz;
rc = zmq_getsockopt (s, ZMQ_RCVMORE, &more, &moresz);
zmq_msg_close (&msg);

If I reverse the order of the getsockopt and close calls, it works as expected. The crash is here:

#0 zmq_msg_close (msg_=0x7fffbf45f860) at zmq.cpp:151
151 if (content->ffn)

Test case is a sub socket reading off a pub socket, same test case as issue 191.

Environment

None

Status

Assignee

Unassigned

Reporter

PieterP

Labels

None

Priority