From e1cfc18a78195cce9504b61f0aaeb4b61582fa15 Mon Sep 17 00:00:00 2001 From: Kevin Harwell Date: Thu, 29 Aug 2013 21:37:29 +0000 Subject: 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 --- main/asterisk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'main/asterisk.c') 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); -- cgit v1.2.3