Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
faea3db9
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
faea3db9
编写于
7月 13, 2005
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix libpq memory leak during PQreset() --- closePGconn() was not
freeing all transient state of the PGconn object.
上级
5d0a43c5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
2 deletion
+30
-2
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+30
-2
未找到文件。
src/interfaces/libpq/fe-connect.c
浏览文件 @
faea3db9
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.31
3 2005/06/27 02:04:26 neilc
Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.31
4 2005/07/13 15:25:55 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1874,6 +1874,8 @@ makeEmptyPGconn(void)
/*
* freePGconn
* - free the PGconn data structure
*
* When changing/adding to this function, see also closePGconn!
*/
static
void
freePGconn
(
PGconn
*
conn
)
...
...
@@ -1921,6 +1923,7 @@ freePGconn(PGconn *conn)
free
(
conn
->
krbsrvname
);
#endif
/* Note that conn->Pfdebug is not ours to close or free */
freeaddrinfo_all
(
conn
->
addrlist_family
,
conn
->
addrlist
);
notify
=
conn
->
notifyHead
;
while
(
notify
!=
NULL
)
{
...
...
@@ -1929,7 +1932,6 @@ freePGconn(PGconn *conn)
notify
=
notify
->
next
;
free
(
prev
);
}
freeaddrinfo_all
(
conn
->
addrlist_family
,
conn
->
addrlist
);
pstatus
=
conn
->
pstatus
;
while
(
pstatus
!=
NULL
)
{
...
...
@@ -1952,10 +1954,15 @@ freePGconn(PGconn *conn)
/*
* closePGconn
* - properly close a connection to the backend
*
* Release all transient state, but NOT the connection parameters.
*/
static
void
closePGconn
(
PGconn
*
conn
)
{
PGnotify
*
notify
;
pgParameterStatus
*
pstatus
;
/*
* Note that the protocol doesn't allow us to send Terminate messages
* during the startup phase.
...
...
@@ -1991,6 +1998,27 @@ closePGconn(PGconn *conn)
* absent */
conn
->
asyncStatus
=
PGASYNC_IDLE
;
pqClearAsyncResult
(
conn
);
/* deallocate result and curTuple */
freeaddrinfo_all
(
conn
->
addrlist_family
,
conn
->
addrlist
);
conn
->
addrlist
=
NULL
;
conn
->
addr_cur
=
NULL
;
notify
=
conn
->
notifyHead
;
while
(
notify
!=
NULL
)
{
PGnotify
*
prev
=
notify
;
notify
=
notify
->
next
;
free
(
prev
);
}
conn
->
notifyHead
=
NULL
;
pstatus
=
conn
->
pstatus
;
while
(
pstatus
!=
NULL
)
{
pgParameterStatus
*
prev
=
pstatus
;
pstatus
=
pstatus
->
next
;
free
(
prev
);
}
conn
->
pstatus
=
NULL
;
if
(
conn
->
lobjfuncs
)
free
(
conn
->
lobjfuncs
);
conn
->
lobjfuncs
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录