]> git.puffer.fish Git - matthieu/frr.git/commit
lib: avoid double-free in zmq wrapper callbacks
authorMark Stapp <mjs.ietf@gmail.com>
Mon, 9 Aug 2021 15:57:17 +0000 (11:57 -0400)
committermergify-bot <noreply@mergify.io>
Thu, 7 Oct 2021 13:22:20 +0000 (13:22 +0000)
commit6b428a3db6fa72f84066de6b5f47ed7d4bb4242c
tree6a485eefbc1490915fff46789a02e064e954578f
parent66700e0c36fbe36d8313e6916e85763a15813f3d
lib: avoid double-free in zmq wrapper callbacks

There were paths where the zmq wrapper lib could call user
callbacks that would free the internal context struct, but the
context was then used in the lib code. Use a boolean to avoid
freeing the context within an application callback.

Restore logic that frees the context within the 'cancel' api.

Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
(cherry picked from commit 8fd5502b0c2e628b875fdaf1a0ca467f8ba07ce4)
lib/frr_zmq.c
lib/frr_zmq.h