postgresql/src/bin/psql
Tom Lane f463de59d9 In psql, avoid leaking a PGresult after a query is cancelled.
After a query cancel, the tail end of ExecQueryAndProcessResults
took care to clear any not-yet-read PGresults; but it forgot about
the one it has already read.  There would only be such a result
when handling a multi-command string made with "\;", so that you'd
have to cancel an earlier command in such a string to reach the
bug at all.  Even then, there would only be leakage of a single
PGresult per cancel, so it's not surprising nobody noticed this.
But a leak is a leak.

Noted while re-reviewing 90f517821, but this is independent of that:
it dates to 7844c9918.  Back-patch to v15 where that came in.
2024-04-08 17:00:07 -04:00
..
po Update copyright for 2024 2024-01-03 20:49:05 -05:00
t Re-implement psql's FETCH_COUNT feature atop libpq's chunked mode. 2024-04-06 20:45:11 -04:00
.gitignore Add basic TAP tests for psql's tab-completion logic. 2020-01-02 15:02:21 -05:00
Makefile Update copyright for 2024 2024-01-03 20:49:05 -05:00
command.c Send ALPN in TLS handshake, require it in direct SSL connections 2024-04-08 04:24:51 +03:00
command.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
common.c In psql, avoid leaking a PGresult after a query is cancelled. 2024-04-08 17:00:07 -04:00
common.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
copy.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
copy.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
create_help.pl Update copyright for 2024 2024-01-03 20:49:05 -05:00
crosstabview.c Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
crosstabview.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
describe.c Make stxstattarget nullable 2024-03-17 12:26:26 +01:00
describe.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
help.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
help.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
input.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
input.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
large_obj.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
large_obj.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
mainloop.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
mainloop.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls.mk Rename port/thread.c to port/user.c. 2023-07-09 18:17:09 +12:00
prompt.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
prompt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
psqlrc.sample Improve FILES section of psql reference page. 2014-01-14 19:27:57 -05:00
psqlscanslash.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
psqlscanslash.l Allow noise semicolons ending psql \sf, \ef, \sv, \ev commands. 2024-01-10 14:20:09 -05:00
settings.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
startup.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
stringutils.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
stringutils.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tab-complete.c Add more tab completion support for ALTER DEFAULT PRIVILEGES in psql. 2024-04-08 12:15:10 +09:00
tab-complete.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
variables.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
variables.h Update copyright for 2024 2024-01-03 20:49:05 -05:00