postgresql-interfaces/psqlodbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: harukat (@harukat) <[email protected]>
To: postgresql-interfaces/psqlodbc <[email protected]>
Subject: [postgresql-interfaces/psqlodbc] PR #113: SQLFreeStmt(stmt,SQL_DROP) now returns an error when it's conn has been disconnected.
Date: Thu, 24 Apr 2025 04:52:57 +0000
Message-ID: <[email protected]> (raw)

SQLFreeStmt(stmt, SQL_DROP) now returns an error before trying to free statement resources
when its connection already has been closed.

A crash occurred when the PostgreSQL server terminated and a connection was subsequently attempted from an application when connection pooling by the driver manager was enabled and several pooled connections existed. In such cases, an invalid memory access would occur in ENTER_CONN_CS(conn) in SQLFreeStmt(), or an invalid address free() would be attempted in SC_clear_error() via PGAPI_FreeStmt().

"CC_cleanup()" doing "conn->status = CONN_NOT_CONNECTED" releases all statements belonging to the connection, so this change will probably not cause a resource leak.


view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://postgresql-interfaces/psqlodbc
  Cc: [email protected], [email protected]
  Subject: Re: [postgresql-interfaces/psqlodbc] PR #113: SQLFreeStmt(stmt,SQL_DROP) now returns an error when it's conn has been disconnected.
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox