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 <
[email protected]>
Reported-by: Noah Misch <[email protected]>
Discussion: https://postgr.es/m/
20240630190040[email protected]
return (PGcancelConn *) cancelConn;
oom_error:
- conn->status = CONNECTION_BAD;
+ cancelConn->status = CONNECTION_BAD;
libpq_append_conn_error(cancelConn, "out of memory");
return (PGcancelConn *) cancelConn;
}