mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-04 07:27:23 +01:00
fixed GH #2277: SQLite null pointer dereference occurs when exception is being thrown
This commit is contained in:
parent
5c79a93634
commit
d3f44c0209
@ -59,14 +59,16 @@ Utility::TypeMap Utility::_types;
|
||||
Poco::Mutex Utility::_mutex;
|
||||
|
||||
|
||||
Utility::SQLiteMutex::SQLiteMutex(sqlite3* pDB): _pMutex(sqlite3_db_mutex(pDB))
|
||||
Utility::SQLiteMutex::SQLiteMutex(sqlite3* pDB): _pMutex((pDB) ? sqlite3_db_mutex(pDB) : 0)
|
||||
{
|
||||
if (_pMutex)
|
||||
sqlite3_mutex_enter(_pMutex);
|
||||
}
|
||||
|
||||
|
||||
Utility::SQLiteMutex::~SQLiteMutex()
|
||||
{
|
||||
if (_pMutex)
|
||||
sqlite3_mutex_leave(_pMutex);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user