mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-31 07:58:24 +02:00
Poco::Data::PostGreSQL::SessionHandle: free _pConnection when connection attempt fails.
This commit is contained in:
parent
3da8ee633e
commit
c7b6fa17be
@ -88,7 +88,13 @@ void SessionHandle::connect(const std::string& aConnectionString)
|
|||||||
|
|
||||||
if (!isConnectedNoLock())
|
if (!isConnectedNoLock())
|
||||||
{
|
{
|
||||||
throw ConnectionFailedException(std::string("Connection Error: ") + lastErrorNoLock());
|
std::string msg = std::string("Connection Error: ") + lastErrorNoLock();
|
||||||
|
if (_pConnection)
|
||||||
|
{
|
||||||
|
PQfinish(_pConnection);
|
||||||
|
_pConnection = 0;
|
||||||
|
}
|
||||||
|
throw ConnectionFailedException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
_connectionString = aConnectionString;
|
_connectionString = aConnectionString;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user