[svn-commits] mvanbaak: branch group/res_clialiases r145004 - /team/group/res_clialiases/res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Sep 27 16:38:55 CDT 2008


Author: mvanbaak
Date: Sat Sep 27 16:38:54 2008
New Revision: 145004

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145004
Log:
fix memory leak pointed out by file

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

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=145004&r1=145003&r2=145004
==============================================================================
--- team/group/res_clialiases/res/res_clialiases.c (original)
+++ team/group/res_clialiases/res/res_clialiases.c Sat Sep 27 16:38:54 2008
@@ -225,15 +225,15 @@
 		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 = alias->alias;
+		alias->cli_entry._full_cmd = ast_strdup(alias->alias);
 		alias->cli_entry.usage = "Aliased CLI Command";
 		if (!ast_cli_register(&alias->cli_entry)) {
 			ao2_link(cli_aliases, alias);
 			ast_verbose(VERBOSE_PREFIX_2 "Aliased CLI command '%s' to '%s'\n", v->name, v->value);
-			ao2_ref(alias, -1);
 		} else {
 			ast_verbose(VERBOSE_PREFIX_2 "Failed to alias '%s' to '%s' as the CLI command already exists\n", v->name, v->value);
 		}
+		ao2_ref(alias, -1);
 	}
 
 	/* Drop any CLI aliases that should no longer exist */




More information about the svn-commits mailing list