aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2024-07-01 13:58:22 +0200
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2024-07-01 13:58:22 +0200
commit3497c87b05a6ba31e8d760591900d550b2ef98bc (patch)
treeee132350e7d487a57071d57888c39ef80810d84e /src
parent12227a1d5f8ecad296c4204cc924d33c6a6bcd34 (diff)
downloadpostgresql-3497c87b05a6ba31e8d760591900d550b2ef98bc.tar.gz
postgresql-3497c87b05a6ba31e8d760591900d550b2ef98bc.zip
Fix copy-paste mistake in PQcancelCreate
When an OOM occurred, this function was incorrectly setting a status of CONNECTION_BAD on the passed in PGconn instead of on the newly created PGcancelConn. Mistake introduced with 61461a300c1c. Backpatch to 17. Author: Jelte Fennema-Nio <postgres@jeltef.nl> Reported-by: Noah Misch <noah@leadboat.com> Discussion: https://postgr.es/m/20240630190040.26.nmisch@google.com
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/libpq/fe-cancel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-cancel.c b/src/interfaces/libpq/fe-cancel.c
index 3b6206ea7ff..9562a7fe443 100644
--- a/src/interfaces/libpq/fe-cancel.c
+++ b/src/interfaces/libpq/fe-cancel.c
@@ -155,7 +155,7 @@ PQcancelCreate(PGconn *conn)
return (PGcancelConn *) cancelConn;
oom_error:
- conn->status = CONNECTION_BAD;
+ cancelConn->status = CONNECTION_BAD;
libpq_append_conn_error(cancelConn, "out of memory");
return (PGcancelConn *) cancelConn;
}