Skip to content

Commit 4013a5a

Browse files
Fix check for memory allocation
Commit 61461a3 accidentally checked memory allocation success using the wrong variable. Author: Ranier Vilela <ranier.vf@gmail.com> Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://postgr.es/m/CAEudQAqQFTH7xCB-+K6zEKjfqbhqCxcr_w4DuJTxVT6h3vzu2w@mail.gmail.com
1 parent 7c655a0 commit 4013a5a

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
@@ -145,7 +145,7 @@ PQcancelCreate(PGconn *conn)
145145
}
146146

147147
cancelConn->addr = calloc(cancelConn->naddr, sizeof(AddrInfo));
148-
if (!cancelConn->connhost)
148+
if (!cancelConn->addr)
149149
goto oom_error;
150150

151151
cancelConn->addr[0].addr = conn->raddr;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy