summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson2024-05-27 17:37:17 +0000
committerDaniel Gustafsson2024-05-27 17:37:17 +0000
commit4013a5ada25241ead6a3265d6edf9aadb654dc00 (patch)
treec7941e8dabe2612a8995be87fdfc8301dd006ae0
parent7c655a04a2dc84b59ed6dce97bd38b79e734ecca (diff)
Fix check for memory allocation
Commit 61461a300c1 accidentally checked memory allocation success using the wrong variable. Author: Ranier Vilela <[email protected]> Reviewed-by: Jelte Fennema-Nio <[email protected]> Reviewed-by: Daniel Gustafsson <[email protected]> Discussion: https://postgr.es/m/CAEudQAqQFTH7xCB-+K6zEKjfqbhqCxcr_w4DuJTxVT6h3vzu2w@mail.gmail.com
-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 4f00a91b51e..b183eafffad 100644
--- a/src/interfaces/libpq/fe-cancel.c
+++ b/src/interfaces/libpq/fe-cancel.c
@@ -145,7 +145,7 @@ PQcancelCreate(PGconn *conn)
}
cancelConn->addr = calloc(cancelConn->naddr, sizeof(AddrInfo));
- if (!cancelConn->connhost)
+ if (!cancelConn->addr)
goto oom_error;
cancelConn->addr[0].addr = conn->raddr;