diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-10-18 05:02:06 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-10-18 05:02:06 +0000 |
commit | f2f71070244958108a9321f47524d3a40945c682 (patch) | |
tree | c243375f0e9e5474f0674569d14390f705c2b6a7 | |
parent | 0a4048646b1019580fb8ae6637f30a7e0ac1d8e0 (diff) | |
download | postgresql-f2f71070244958108a9321f47524d3a40945c682.tar.gz postgresql-f2f71070244958108a9321f47524d3a40945c682.zip |
Must free the pgParameterStatus chain in freePGconn(). My fault,
well spotted by Neil Conway.
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index cd235a12768..9dde3043c70 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.262 2003/10/02 19:52:44 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.263 2003/10/18 05:02:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2003,8 +2003,11 @@ makeEmptyPGconn(void) static void freePGconn(PGconn *conn) { + pgParameterStatus *pstatus; + if (!conn) return; + pqClearAsyncResult(conn); /* deallocate result and curTuple */ if (conn->sock >= 0) { @@ -2037,6 +2040,14 @@ freePGconn(PGconn *conn) if (conn->notifyList) DLFreeList(conn->notifyList); freeaddrinfo_all(conn->addrlist_family, conn->addrlist); + pstatus = conn->pstatus; + while (pstatus != NULL) + { + pgParameterStatus *prev = pstatus; + + pstatus = pstatus->next; + free(prev); + } if (conn->lobjfuncs) free(conn->lobjfuncs); if (conn->inBuffer) |