From 609ffb429a1892c79748b2531df49f3ae130fef5 Mon Sep 17 00:00:00 2001
From: Mark Michelson <mmichelson@digium.com>
Date: Thu, 13 Dec 2012 15:37:45 +0000
Subject: [PATCH] The UUID commit removed changes made in res_clialiases.c

This puts back in the changes that are designed to work
around a memory leak fix in the CLI code.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 res/res_clialiases.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/res/res_clialiases.c b/res/res_clialiases.c
index d9c4088bc8..17a847648e 100644
--- a/res/res_clialiases.c
+++ b/res/res_clialiases.c
@@ -218,7 +218,10 @@ static void load_config(int reload)
 			alias->cli_entry.command = alias->alias;
 			alias->cli_entry.usage = "Aliased CLI Command\n";
 
-			ast_cli_register(&alias->cli_entry);
+			if (ast_cli_register(&alias->cli_entry)) {
+				ao2_ref(alias, -1);
+				continue;
+			}
 			ao2_link(cli_aliases, alias);
 			ast_verb(2, "Aliased CLI command '%s' to '%s'\n", v1->name, v1->value);
 			ao2_ref(alias, -1);
-- 
GitLab