Memory leaks fix

(closes ASTERISK-22376)
Reported by: John Hardin
Patches:
     memleak.patch uploaded by jhardin (license 6512)
     memleak2.patch uploaded by jhardin (license 6512)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin Harwell
2013-08-29 21:34:52 +00:00
parent 39c984ef20
commit 4017609f8f
8 changed files with 17 additions and 4 deletions

View File

@@ -1921,7 +1921,7 @@ static int can_safely_quit(shutdown_nice_t niceness, int restart)
static void really_quit(int num, shutdown_nice_t niceness, int restart)
{
int active_channels;
RAII_VAR(struct ast_json *, json_object, NULL, ast_json_unref);
struct ast_json *json_object = NULL;
int run_cleanups = niceness >= SHUTDOWN_NICE;
if (run_cleanups) {
@@ -1959,6 +1959,8 @@ static void really_quit(int num, shutdown_nice_t niceness, int restart)
"Shutdown", active_channels ? "Uncleanly" : "Cleanly",
"Restart", restart ? "True" : "False");
ast_manager_publish_event("Shutdown", EVENT_FLAG_SYSTEM, json_object);
ast_json_unref(json_object);
json_object = NULL;
}
ast_verb(0, "Asterisk %s ending (%d).\n",
active_channels ? "uncleanly" : "cleanly", num);