提交 9658d82b authored 作者: Michael Jerris's avatar Michael Jerris

fix a little leak reported by skopii

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9240 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 e8137974
...@@ -165,7 +165,7 @@ char *expand_alias(char *cmd, char *arg) ...@@ -165,7 +165,7 @@ char *expand_alias(char *cmd, char *arg)
{ {
char *errmsg = NULL; char *errmsg = NULL;
char *r = NULL; char *r = NULL;
char *sql; char *sql = NULL;
char *exp = NULL; char *exp = NULL;
switch_core_db_t *db = switch_core_db_handle(); switch_core_db_t *db = switch_core_db_handle();
int full = 0; int full = 0;
...@@ -179,6 +179,8 @@ char *expand_alias(char *cmd, char *arg) ...@@ -179,6 +179,8 @@ char *expand_alias(char *cmd, char *arg)
free(errmsg); free(errmsg);
} }
switch_safe_free(sql);
if (!r) { if (!r) {
sql = switch_mprintf("select command from aliases where alias='%q %q'", cmd, arg); sql = switch_mprintf("select command from aliases where alias='%q %q'", cmd, arg);
...@@ -193,6 +195,7 @@ char *expand_alias(char *cmd, char *arg) ...@@ -193,6 +195,7 @@ char *expand_alias(char *cmd, char *arg)
} }
} }
switch_safe_free(sql);
if (r) { if (r) {
if (arg && !full) { if (arg && !full) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论