[Broker] Fix auth plugin cleanup function not being called.

Closes #900.

Thanks to Julian Zhao.

Signed-off-by: Roger A. Light <roger@atchoo.org>
pull/1600/head
Roger A. Light 7 years ago
parent 65dfe291e2
commit 9f8e2a1d0a

@ -1,3 +1,11 @@
1.5.1 - 2018xxxx
================
Broker:
- Fix plugin cleanup function not being called on exit of the broker.
Closes #900.
1.5 - 20180502
==============

@ -282,6 +282,20 @@ static void security__module_cleanup_single(struct mosquitto__security_options *
int i;
for(i=0; i<opts->auth_plugin_config_count; i++){
/* Run plugin cleanup function */
if(opts->auth_plugin_configs[i].plugin.version == 3){
opts->auth_plugin_configs[i].plugin.plugin_cleanup_v3(
opts->auth_plugin_configs[i].plugin.user_data,
opts->auth_plugin_configs[i].options,
opts->auth_plugin_configs[i].option_count);
}else if(opts->auth_plugin_configs[i].plugin.version == 2){
opts->auth_plugin_configs[i].plugin.plugin_cleanup_v2(
opts->auth_plugin_configs[i].plugin.user_data,
(struct mosquitto_auth_opt *)opts->auth_plugin_configs[i].options,
opts->auth_plugin_configs[i].option_count);
}
if(opts->auth_plugin_configs[i].plugin.lib){
LIB_CLOSE(opts->auth_plugin_configs[i].plugin.lib);
}

Loading…
Cancel
Save