mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Change PQconndefaults() to return a malloc'd array, instead of a static
array. This allows processing of conninfo strings to be made thread-safe, at the cost of a small memory leak in applications that use PQconndefaults() and are not updated to free the returned array via the new PQconninfoFree() function. But PQconndefaults() is probably not used very much, so this seems like a good compromise.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: libpq-int.h,v 1.19 2000/02/07 23:10:11 petere Exp $
|
||||
* $Id: libpq-int.h,v 1.20 2000/03/11 03:08:37 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -121,7 +121,21 @@ struct pg_result
|
||||
* last query */
|
||||
int binary; /* binary tuple values if binary == 1,
|
||||
* otherwise ASCII */
|
||||
PGconn *conn; /* connection we did the query on, if any */
|
||||
/*
|
||||
* The conn link in PGresult is no longer used by any libpq code.
|
||||
* It should be removed entirely, because it could be a dangling link
|
||||
* (the application could keep the PGresult around longer than it keeps
|
||||
* the PGconn!) But there may be apps out there that depend on it,
|
||||
* so we will leave it here at least for a release or so.
|
||||
*/
|
||||
PGconn *xconn; /* connection we did the query on, if any */
|
||||
|
||||
/* Callback procedure for notice/error message processing
|
||||
* (copied from originating PGconn).
|
||||
*/
|
||||
PQnoticeProcessor noticeHook;
|
||||
void *noticeArg;
|
||||
|
||||
char *errMsg; /* error message, or NULL if no error */
|
||||
|
||||
/* All NULL attributes in the query result point to this null string */
|
||||
|
Reference in New Issue
Block a user