summaryrefslogtreecommitdiff
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2013-08-29 21:37:29 +0000
committerKevin Harwell <kharwell@digium.com>2013-08-29 21:37:29 +0000
commite1cfc18a78195cce9504b61f0aaeb4b61582fa15 (patch)
treefa20c92a1aa3ae73d33d8394a9e5dc723837dff5 /main/asterisk.c
parent449afdd9e8d38a5a479cc0320091fd315d2b4d4a (diff)
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) ........ Merged revisions 397946 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index abd4742c4..d425048f1 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -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);