Final set of patches in a series of memory leak/cleanup patches by Corey Farrell
(closes issue ASTERISK-22467)
Reported by: Corey Farrell
Patches:
main-utils-1.8.patch uploaded by coreyfarrell (license 5909)
main-utils-11.patch uploaded by coreyfarrell (license 5909)
main-utils-12up.patch uploaded by coreyfarrell (license 5909)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@401829
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
struct thr_lock_info *lock_info;
struct ast_str *str;
- if (!(str = ast_str_create(4096)))
- return CLI_FAILURE;
-
switch (cmd) {
case CLI_INIT:
e->command = "core show locks";
return NULL;
}
+ if (!(str = ast_str_create(4096)))
+ return CLI_FAILURE;
+
ast_str_append(&str, 0, "\n"
"=======================================================================\n"
"=== %s\n"
return 0;
}
+#if defined(DEBUG_THREADS) && !defined(LOW_MEMORY)
+static void utils_shutdown(void)
+{
+ ast_cli_unregister_multiple(utils_cli, ARRAY_LEN(utils_cli));
+}
+#endif
+
int ast_utils_init(void)
{
#ifdef HAVE_DEV_URANDOM
#ifdef DEBUG_THREADS
#if !defined(LOW_MEMORY)
ast_cli_register_multiple(utils_cli, ARRAY_LEN(utils_cli));
+ ast_register_atexit(utils_shutdown);
#endif
#endif
return 0;