mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
freeaddrinfo2() does need two parameters after all, per comment by
Kurt Roeckx. Add some documentation to try to prevent others from repeating my mistake.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.242 2003/06/08 17:43:00 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.243 2003/06/09 17:59:19 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -848,7 +848,7 @@ connectDBStart(PGconn *conn)
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("getaddrinfo() failed: %s\n"),
|
||||
gai_strerror(ret));
|
||||
freeaddrinfo2(addrs);
|
||||
freeaddrinfo2(hint.ai_family, addrs);
|
||||
goto connect_errReturn;
|
||||
}
|
||||
|
||||
@@ -857,6 +857,7 @@ connectDBStart(PGconn *conn)
|
||||
*/
|
||||
conn->addrlist = addrs;
|
||||
conn->addr_cur = addrs;
|
||||
conn->addrlist_family = hint.ai_family;
|
||||
conn->pversion = PG_PROTOCOL(3,0);
|
||||
conn->status = CONNECTION_NEEDED;
|
||||
|
||||
@@ -1686,7 +1687,7 @@ retry_ssl_read:
|
||||
}
|
||||
|
||||
/* We can release the address list now. */
|
||||
freeaddrinfo2(conn->addrlist);
|
||||
freeaddrinfo2(conn->addrlist_family, conn->addrlist);
|
||||
conn->addrlist = NULL;
|
||||
conn->addr_cur = NULL;
|
||||
|
||||
@@ -1858,7 +1859,7 @@ freePGconn(PGconn *conn)
|
||||
/* Note that conn->Pfdebug is not ours to close or free */
|
||||
if (conn->notifyList)
|
||||
DLFreeList(conn->notifyList);
|
||||
freeaddrinfo2(conn->addrlist);
|
||||
freeaddrinfo2(conn->addrlist_family, conn->addrlist);
|
||||
if (conn->lobjfuncs)
|
||||
free(conn->lobjfuncs);
|
||||
if (conn->inBuffer)
|
||||
|
@@ -12,7 +12,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: libpq-int.h,v 1.71 2003/06/08 17:43:00 tgl Exp $
|
||||
* $Id: libpq-int.h,v 1.72 2003/06/09 17:59:19 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -270,6 +270,7 @@ struct pg_conn
|
||||
/* Transient state needed while establishing connection */
|
||||
struct addrinfo *addrlist; /* list of possible backend addresses */
|
||||
struct addrinfo *addr_cur; /* the one currently being tried */
|
||||
int addrlist_family; /* needed to know how to free addrlist */
|
||||
PGSetenvStatusType setenv_state; /* for 2.0 protocol only */
|
||||
const PQEnvironmentOption *next_eo;
|
||||
|
||||
|
Reference in New Issue
Block a user