Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit415b925

Browse files
author
Neil Conway
committed
Fix a memory leak in psql: we'd leak a few PGresult handles if
a connectivity error occurred while executing one of the queriesfor "\d <table>". Not serious, but still worth fixing. Patch fromBrendan Jurd.
1 parent8964b41 commit415b925

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/bin/psql/describe.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.147 2006/10/09 23:30:33 tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.148 2006/11/08 01:22:55 neilc Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"describe.h"
@@ -1171,7 +1171,14 @@ describeOneTableDetails(const char *schemaname,
11711171

11721172
result6=PSQLexec(buf.data, false);
11731173
if (!result6)
1174+
{
1175+
PQclear(result1);
1176+
PQclear(result2);
1177+
PQclear(result3);
1178+
PQclear(result4);
1179+
PQclear(result5);
11741180
gotoerror_return;
1181+
}
11751182
else
11761183
inherits_count=PQntuples(result6);
11771184

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp