Free opaque in dr_msg_cb #4124
-
In a producer application I'm doing this:
Then in the dr_msg_cb:
But Valgrind still reports the xmalloc'd memory as leaked. From my understanding of librdkafka docs and reading the code, the lib makes a copy of the topic, also a copy of the payload if RD_KAFKA_MSG_F_COPY but not a copy of the opaque. So I'm manually allocating memory for the opaque and then attempting to free it in the callback. Any suggestions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It just turns out the application needed to xfree the opaque also on err. So just an oversight. This can be marked as answered. |
Beta Was this translation helpful? Give feedback.
It just turns out the application needed to xfree the opaque also on err. So just an oversight. This can be marked as answered.