From 05d4766aef3096ec3019f88fd40c6c9e438c52a2 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 24 Nov 2020 13:09:57 +0000 Subject: [PATCH] Fix plugin callback not being correctly removed. --- src/plugin.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugin.c b/src/plugin.c index 4625eba6..a31356c4 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -40,13 +40,13 @@ static bool check_callback_exists(struct mosquitto__callback *cb_base, MOSQ_FUNC } -static int remove_callback(struct mosquitto__callback *cb_base, MOSQ_FUNC_generic_callback cb_func) +static int remove_callback(struct mosquitto__callback **cb_base, MOSQ_FUNC_generic_callback cb_func) { struct mosquitto__callback *tail, *tmp; - DL_FOREACH_SAFE(cb_base, tail, tmp){ + DL_FOREACH_SAFE(*cb_base, tail, tmp){ if(tail->cb == cb_func){ - DL_DELETE(cb_base, tail); + DL_DELETE(*cb_base, tail); mosquitto__free(tail); return MOSQ_ERR_SUCCESS; } @@ -315,5 +315,5 @@ int mosquitto_callback_unregister( break; } - return remove_callback(*cb_base, cb_func); + return remove_callback(cb_base, cb_func); }