Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3497c87

Browse files
committed
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 61461a3. 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
1 parent 12227a1 commit 3497c87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interfaces/libpq/fe-cancel.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ PQcancelCreate(PGconn *conn)
155155
return (PGcancelConn *) cancelConn;
156156

157157
oom_error:
158-
conn->status = CONNECTION_BAD;
158+
cancelConn->status = CONNECTION_BAD;
159159
libpq_append_conn_error(cancelConn, "out of memory");
160160
return (PGcancelConn *) cancelConn;
161161
}

0 commit comments

Comments
 (0)