Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
192c0143
提交
192c0143
authored
10月 10, 2012
作者:
Eliot Gable
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix execute_string() function and fix memory leak in _callback() function.
上级
b1c90dff
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
10 行删除
+15
-10
switch_pgsql.c
src/switch_pgsql.c
+15
-10
没有找到文件。
src/switch_pgsql.c
浏览文件 @
192c0143
...
@@ -496,9 +496,19 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_exec_string(switch_pgs
...
@@ -496,9 +496,19 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_exec_string(switch_pgs
goto
error
;
goto
error
;
}
}
if
(
!
result
||
result
->
status
!=
PGRES_COMMAND_OK
)
{
if
(
!
result
)
{
sstatus
=
SWITCH_PGSQL_FAIL
;
switch
(
result
->
status
)
{
goto
done
;
#if POSTGRESQL_MAJOR_VERSION >= 9 && POSTGRESQL_MINOR_VERSION >= 2
case
PGRES_SINGLE_TUPLE
:
/* Added in PostgreSQL 9.2 */
#endif
case
PGRES_COMMAND_OK
:
case
PGRES_TUPLES_OK
:
break
;
default
:
sstatus
=
SWITCH_PGSQL_FAIL
;
goto
done
;
}
}
}
if
(
handle
->
affected_rows
<=
0
)
{
if
(
handle
->
affected_rows
<=
0
)
{
...
@@ -658,7 +668,8 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_callback_exec_detailed
...
@@ -658,7 +668,8 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_callback_exec_detailed
/*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Executing callback for row %d...\n", row);*/
/*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Executing callback for row %d...\n", row);*/
if
(
callback
(
pdata
,
result
->
cols
,
vals
,
names
))
{
if
(
callback
(
pdata
,
result
->
cols
,
vals
,
names
))
{
goto
done
;
switch_pgsql_finish_results
(
handle
);
/* Makes sure next call to switch_pgsql_next_result will return NULL */
row
=
result
->
rows
;
/* Makes us exit the for loop */
}
}
for
(
col
=
0
;
col
<
result
->
cols
;
++
col
)
{
for
(
col
=
0
;
col
<
result
->
cols
;
++
col
)
{
...
@@ -686,12 +697,6 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_callback_exec_detailed
...
@@ -686,12 +697,6 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_callback_exec_detailed
goto
error
;
goto
error
;
}
}
done
:
if
(
result
)
{
switch_pgsql_free_result
(
&
result
);
}
switch_pgsql_finish_results
(
handle
);
return
SWITCH_PGSQL_SUCCESS
;
return
SWITCH_PGSQL_SUCCESS
;
error
:
error
:
#endif
#endif
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论