8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:00:38 +01:00

Fixed #7393: Access violation after double fault in attachDatabase().

This commit is contained in:
AlexPeshkoff 2022-11-22 19:28:49 +03:00
parent bde76dd9fb
commit 3de8a01891

View File

@ -8700,7 +8700,27 @@ static void unwindAttach(thread_db* tdbb, const char* filename, const Exception&
traceManager->event_detach(&conn, false);
attachment->att_flags |= flags;
release_attachment(tdbb, attachment);
try
{
release_attachment(tdbb, attachment);
}
catch (const Exception&)
{
// Minimum cleanup instead is needed to avoid repeated call
// of release_attachment() when decrementing reference counter of jAtt.
try
{
Attachment::destroy(attachment);
}
catch (const Exception&)
{
// Let's be absolutely minimalistic though
// this will almost for sure cause assertion in DEV_BUILD.
sAtt->cancel();
attachment->setStable(NULL);
sAtt->manualUnlock(attachment->att_flags);
}
}
}
else
{