git migration: Refactor the ASTERISK_FILE_VERSION macro
[asterisk/asterisk.git] / main / named_acl.c
index a93f789..0fc4df1 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+ASTERISK_REGISTER_FILE()
 
 #include "asterisk/config.h"
 #include "asterisk/config_options.h"
@@ -380,7 +380,7 @@ static int publish_acl_change(const char *name)
        RAII_VAR(struct ast_json_payload *, json_payload, NULL, ao2_cleanup);
        RAII_VAR(struct ast_json *, json_object, ast_json_object_create(), ast_json_unref);
 
-       if (!json_object) {
+       if (!json_object || !ast_named_acl_change_type()) {
                goto publish_failure;
        }
 
@@ -567,6 +567,8 @@ static struct ast_cli_entry cli_named_acl[] = {
 
 static void named_acl_cleanup(void)
 {
+       ast_cli_unregister_multiple(cli_named_acl, ARRAY_LEN(cli_named_acl));
+
        STASIS_MESSAGE_TYPE_CLEANUP(ast_named_acl_change_type);
        aco_info_destroy(&cfg_info);
        ao2_global_obj_release(globals);
@@ -588,10 +590,7 @@ int ast_named_acl_init()
        aco_option_register(&cfg_info, "permit", ACO_EXACT, named_acl_types, NULL, OPT_ACL_T, 1, FLDSET(struct named_acl, ha));
        aco_option_register(&cfg_info, "deny", ACO_EXACT, named_acl_types, NULL, OPT_ACL_T, 0, FLDSET(struct named_acl, ha));
 
-       if (aco_process_config(&cfg_info, 0)) {
-               aco_info_destroy(&cfg_info);
-               return 0;
-       }
+       aco_process_config(&cfg_info, 0);
 
        return 0;
 }