The UUID commit removed changes made in res_clialiases.c
authorMark Michelson <mmichelson@digium.com>
Thu, 13 Dec 2012 15:37:45 +0000 (15:37 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 13 Dec 2012 15:37:45 +0000 (15:37 +0000)
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

index d9c4088..17a8476 100644 (file)
@@ -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);