[asterisk-commits] file: branch group/res_clialiases r145074 - in /team/group/res_clialiases: ma...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Sep 28 13:25:39 CDT 2008


Author: file
Date: Sun Sep 28 13:25:39 2008
New Revision: 145074

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145074
Log:
Fix a memory leak which was trying to fix another issue. If _full_cmd has not yet been populated use the command value instead.

Modified:
    team/group/res_clialiases/main/cli.c
    team/group/res_clialiases/res/res_clialiases.c

Modified: team/group/res_clialiases/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/main/cli.c?view=diff&rev=145074&r1=145073&r2=145074
==============================================================================
--- team/group/res_clialiases/main/cli.c (original)
+++ team/group/res_clialiases/main/cli.c Sun Sep 28 13:25:39 2008
@@ -1463,7 +1463,7 @@
 	AST_RWLIST_WRLOCK(&helpers);
 	
 	if (find_cli(e->cmda, 1)) {
-		ast_log(LOG_WARNING, "Command '%s' already registered (or something close enough)\n", e->_full_cmd);
+		ast_log(LOG_WARNING, "Command '%s' already registered (or something close enough)\n", !ast_strlen_zero(e->_full_cmd) ? e->_full_cmd : e->command);
 		goto done;
 	}
 	if (set_full_cmd(e))

Modified: team/group/res_clialiases/res/res_clialiases.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/res/res_clialiases.c?view=diff&rev=145074&r1=145073&r2=145074
==============================================================================
--- team/group/res_clialiases/res/res_clialiases.c (original)
+++ team/group/res_clialiases/res/res_clialiases.c Sun Sep 28 13:25:39 2008
@@ -75,10 +75,6 @@
 	/* Unregister the CLI entry from the core */
 	if (alias->registered) {
 		ast_cli_unregister(&alias->cli_entry);
-	}
-
-	if (alias->cli_entry._full_cmd) {
-		ast_free(alias->cli_entry._full_cmd);
 	}
 
 	ast_free(alias->alias);
@@ -230,7 +226,6 @@
 		alias->real_cmd = ast_strdup(v->value);
 		alias->cli_entry.handler = cli_alias_passthrough;
 		alias->cli_entry.command = alias->alias;
-		alias->cli_entry._full_cmd = ast_strdup(alias->alias);
 		alias->cli_entry.usage = "Aliased CLI Command";
 
 		/* Make sure the real command this alias points to really exists */




More information about the asterisk-commits mailing list