summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/config.c4
-rw-r--r--main/utils.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/main/config.c b/main/config.c
index 0aa6bbefc..7e5141398 100644
--- a/main/config.c
+++ b/main/config.c
@@ -3821,6 +3821,9 @@ static void config_shutdown(void)
AST_LIST_UNLOCK(&cfmtime_head);
ast_cli_unregister_multiple(cli_config, ARRAY_LEN(cli_config));
+
+ ao2_cleanup(cfg_hooks);
+ cfg_hooks = NULL;
}
int register_config_cli(void)
@@ -3909,5 +3912,6 @@ int ast_config_hook_register(const char *name,
hook->module = ast_strdup(module);
ao2_link(cfg_hooks, hook);
+ ao2_ref(hook, -1);
return 0;
}
diff --git a/main/utils.c b/main/utils.c
index 7032631f8..578a01e26 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -1856,7 +1856,7 @@ void ast_join_delim(char *s, size_t len, const char * const w[], unsigned int si
/* Join words into a string */
if (!s)
return;
- for (x = 0; ofs < len && w[x] && x < size; x++) {
+ for (x = 0; ofs < len && x < size && w[x] ; x++) {
if (x > 0)
s[ofs++] = delim;
for (src = w[x]; *src && ofs < len; src++)