Content-Length: 252293 | pFad | http://github.com/postgres/postgres/commit/917c00d761fa9ba3b2bc365804ef38fc60ec023e

BA Fix allocation check to test the right variable · postgres/postgres@917c00d · GitHub
Skip to content

Commit 917c00d

Browse files
Fix allocation check to test the right variable
The memory allocation for cancelConn->be_cancel_key was accidentally checking the be_cancel_key member in the conn object instead of the one in cancelConn. Author: Ranier Vilela <ranier.vf@gmail.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://postgr.es/m/CAEudQAq4ySDR6dsg9xwurBXwud02hX7XCOZZAcZx-JMn6A06nA@mail.gmail.com
1 parent 0cf205e commit 917c00d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interfaces/libpq/fe-cancel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ PQcancelCreate(PGconn *conn)
114114
if (conn->be_cancel_key != NULL)
115115
{
116116
cancelConn->be_cancel_key = malloc(conn->be_cancel_key_len);
117-
if (!conn->be_cancel_key)
117+
if (cancelConn->be_cancel_key == NULL)
118118
goto oom_error;
119119
memcpy(cancelConn->be_cancel_key, conn->be_cancel_key, conn->be_cancel_key_len);
120120
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgres/postgres/commit/917c00d761fa9ba3b2bc365804ef38fc60ec023e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy