Skip to content

Commit 7dc5472

Browse files
committed
Missing calls to PQclear in large_obj.c and describe.c.
Greg Sabino Mullane
1 parent b256f24 commit 7dc5472

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/bin/psql/describe.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000-2002 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.77 2003/05/28 16:03:59 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.78 2003/06/27 16:55:22 tgl Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "describe.h"
@@ -963,7 +963,10 @@ describeOneTableDetails(const char *schemaname,
963963
oid);
964964
result2 = PSQLexec(buf.data, false);
965965
if (!result2)
966+
{
967+
PQclear(result1);
966968
goto error_return;
969+
}
967970
else
968971
check_count = PQntuples(result2);
969972
}
@@ -978,7 +981,11 @@ describeOneTableDetails(const char *schemaname,
978981
oid);
979982
result3 = PSQLexec(buf.data, false);
980983
if (!result3)
984+
{
985+
PQclear(result1);
986+
PQclear(result2);
981987
goto error_return;
988+
}
982989
else
983990
rule_count = PQntuples(result3);
984991
}
@@ -998,7 +1005,12 @@ describeOneTableDetails(const char *schemaname,
9981005
oid);
9991006
result4 = PSQLexec(buf.data, false);
10001007
if (!result4)
1008+
{
1009+
PQclear(result1);
1010+
PQclear(result2);
1011+
PQclear(result3);
10011012
goto error_return;
1013+
}
10021014
else
10031015
trigger_count = PQntuples(result4);
10041016
}
@@ -1014,7 +1026,13 @@ describeOneTableDetails(const char *schemaname,
10141026
oid);
10151027
result5 = PSQLexec(buf.data, false);
10161028
if (!result5)
1029+
{
1030+
PQclear(result1);
1031+
PQclear(result2);
1032+
PQclear(result3);
1033+
PQclear(result4);
10171034
goto error_return;
1035+
}
10181036
else
10191037
foreignkey_count = PQntuples(result5);
10201038
}

src/bin/psql/large_obj.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000-2002 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.25 2003/04/18 23:38:47 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.26 2003/06/27 16:55:23 tgl Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "large_obj.h"
@@ -78,6 +78,7 @@ handle_transaction(void)
7878
}
7979

8080
PQsetNoticeProcessor(pset.db, old_notice_hook, NULL);
81+
PQclear(res);
8182
return true;
8283
}
8384

@@ -324,6 +325,7 @@ do_lo_unlink(const char *loid_arg)
324325
}
325326
return false;
326327
}
328+
PQclear(res);
327329
}
328330

329331
if (own_transaction)

0 commit comments

Comments
 (0)