提交 5418702c authored 作者: Michael Jerris's avatar Michael Jerris

don't leak db handle when called api command with session. Found by Klockwork (www.klocwork.com)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8451 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 2d14539e
......@@ -1921,7 +1921,7 @@ SWITCH_STANDARD_API(show_function)
{
char sql[1024];
char *errmsg;
switch_core_db_t *db = switch_core_db_handle();
switch_core_db_t *db;
struct holder holder = { 0 };
int help = 0;
char *mydata = NULL, *argv[6] = {0};
......@@ -1933,6 +1933,8 @@ SWITCH_STANDARD_API(show_function)
return SWITCH_STATUS_FALSE;
}
db = switch_core_db_handle();
if (cmd && (mydata = strdup(cmd))) {
argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
command = argv[0];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论