Menu

#344 TDocManager::CreateDoc is not exception-safe

7
closed
1
2020-05-18
2016-08-18
No

See the implementation of TDocManager::CreateDoc. It calls InitDoc, which in turn calls virtual functions TDocument::SetDocPath and InitDoc without any handling of potential exceptions thrown from these functions. If any of these functions throw an exception, then CreateDoc will leak the TDocument it failed to create.

Related

Bugs: #543
Wiki: Exceptions_and_OWLNext

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2016-08-23
    • status: open --> pending
    • assigned_to: Vidar Hasfjord
    • Group: unspecified --> 7
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2016-08-23

    This issue is now fixed on the trunk [r3454], and the fix has been merged into Owlet [r3455].

    The function now ensures that the document created is not left dangling, should an exception occur during initialization. A trace statement now logs initialization failure.

     

    Related

    Commit: [r3454]
    Commit: [r3455]

  • Vidar Hasfjord

    Vidar Hasfjord - 2020-05-18
    • Status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB