Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-579

purify reports memory leaked by strstreambuf example

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.1
    • Component/s: Examples
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Severity:
      Incorrect Behavior

      Description

      The example calls out.rdbuf()->str() which calls freeze(). If the buffer if frozen, the destructir is not allowed to free the memory [D.7.1.2 p8].

            • Purify instrumented ./strstreambuf (pid 27069) ****
              Purify: Searching for all memory leaks...

      Memory leaked: 200 bytes (100%); potentially leaked: 0 bytes (0%)

      MLK: 200 bytes leaked at 0x80c01d8

      • This memory was allocated from:
        malloc [rtlib.o]
        operator new(unsigned) [libstd15d.so]
        operator new [](unsigned) [libstd15d.so]
        std::strstreambuf::setbuf(char*, int) [strstream.cpp:292]
        std::basic_streambuf<char, std::char_traits<char> >::pubsetbuf(char*, int) [streambuf:91]
        main [strstreambuf.cpp:78]

        Attachments

        1. stdcxx-579.patch
          0.5 kB
          Travis Vitek

          Activity

            People

            • Assignee:
              vitek Travis Vitek
              Reporter:
              vitek Travis Vitek

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment