Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-727

Memory leak in atomicOpsMutex

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 2.1.0
    • 2.2.0
    • Utilities
    • None
    • Operating System: All
      Platform: All
    • 14723

    Description

      For several platforms, there exists an XMLMutex named atomicOpsMutex. This
      object is a global with static scope, and should have its constructor executed
      on startup. After its constructor has finished, atomicOpsMutex.fHandle should
      point to a valid mutex.

      XMLPlatformUtils::platformInit() will re-assign atomicOpsMutex.fHandle without
      checking if the pointer is non-0, thereby leaking the initial mutex. This
      occurs on Linux, FreeBSD, HP-UX, and IRIX.

      I made a simple conditional in each offending source file:

      if (atomicOpsMutex.fHandle == 0)
      {
      atomicOpsMutex.fHandle = XMLPlatformUtils::makeMutex();
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            zell@best.com Adam Zell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: