diff --git a/statement.c b/statement.c index c6e28f6..707370e 100644 --- a/statement.c +++ b/statement.c @@ -291,6 +291,8 @@ PGAPI_FreeStmt(HSTMT hstmt, return SQL_ERROR; /* stmt may be executing a * transaction */ } + // remove the connection from the statement + stmt->hdbc = NULL; } if (stmt->execute_delegate)